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

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

tags - Jquery Mixitup plugin help prevent handlers being destroyed -

c# - Delving into the world of XML (Windows Phone) Error I dont understand (The ' ' character, hexadecimal value 0x20, cannot be included in a name.) -