Ahmed Selim Ahmed Selim - 10 months ago 59
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;