concatenation Operator with tab character

1,523 views
Skip to first unread message

Serious_Developer

unread,
Sep 15, 2012, 10:31:25 AM9/15/12
to Oracle PL/SQL
How can I concatenate tab character with 2 fields ?

SELECT last_name||char(9)||job_id AS "Employees"
FROM employees

James Evans

unread,
Nov 17, 2012, 6:06:19 AM11/17/12
to oracle...@googlegroups.com
I'm not sure there is a tab per se Serious_Developer. But you can mimic a tab by using a string literal;

------------
SELECT last_name
       || '           '
       || job_id AS "Employees"
FROM   employees 

-----------
There's 11 spaces in the string literal.
1 space to appear after last_name
9 spaces that you want
1 extra space (to appear before job_id is displayed)

ddf

unread,
Nov 19, 2012, 3:08:30 PM11/19/12
to oracle...@googlegroups.com
Don't use char(); the function in Oracle is chr():

SELECT        last_name||chr(9)||job_id AS "Employees" 
FROM         employees;

will get you what you want.



David Fitzjarrell
Reply all
Reply to author
Forward
0 new messages