Ahmed Selim Ahmed Selim - 8 months ago 39
SQL Question

Selecting form with SUBSTR

I have a table with name and profession I need to select the name of all employees with the first letter of their profession surrounded by () to be like:

Sara (D)
Jack (E)


Use || to concatenate strings and SUBSTR() to get the first character:

SELECT name || ' (' || SUBSTR( profession, 1,, 1 ) || ')'
FROM   your_table;