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

javascript - CasperJS/PhantomJS failing SSL handshakes on some sites even with --ssl-protocol=any -

codeigniter - Fatal error: Call to undefined function lang() in CI Merchant using CardSave -

python - Received unregistered task using Celery with Django -