menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Databases

>

Substring ...
source image

Dev

1M

read

352

img
dot

Image Credit: Dev

Substring from a Column of Strings — From SQL to SPL #25

  • Retrieve the word ‘EN’ and the subsequent string of numbers from the DESCRIPTION field in a database table tbl.
  • If the string does not contain ‘EN’, return null. The string of numbers may include digits and special characters like '/', '-', '+', '%', or '_'.
  • In SQL, the task can be completed using CROSS APPLY with XML syntax, but the code is complex and lengthy.
  • In SPL (Structured Pattern Language), the task can be achieved using string-splitting functions and ordered calculation functions with simple and easy-to-understand code.

Read Full Article

like

21 Likes

For uninterrupted reading, download the app