Friday, 23 August 2013

SQL How to add parentheses to output data

SQL How to add parentheses to output data

For a college assignment I need to show the last column ouput data in
parentheses as show below:-
My current query is:-

SELECT
SUBSTRING(FirstName,1,1) AS '',
'.' AS'',
LastName AS '', UPPER(Title) AS ''
FROM employees
WHERE (Title !='Sales Representative');

This query shows the output as:-
B . Brown STOREMAN
C . Carr RECEPTIONIST
D . Dig DRIVER

I need it to show:-
B . Brown (STOREMAN)
C . Carr (RECEPTIONIST)
D . Dig (DRIVER)

No comments:

Post a Comment