SQL How to add parentheses to output data -
for college assignment need show last column of output data in parentheses shown below.
my current query is:
select substring(firstname,1,1) '', '.' '', lastname '', upper(title) '' employees (title != 'sales representative');
this query shows output as:
b . brown storeman c . carr receptionist d . dig driver
i need show:
b . brown (storeman) c . carr (receptionist) d . dig (driver)
you should able using concat function
select substring(firstname,1,1) '', '.' as'', lastname '', concat('(',upper(title),')') '' employees (title !='sales representative');
Comments
Post a Comment