Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: what this mean ||

Re: what this mean ||

From: Sydney Palmer <sydpalm_at_home.com>
Date: Sun, 24 Jun 2001 21:57:02 GMT
Message-ID: <3B366234.62D1@home.com>

Imen Eladham wrote:
>
> hi there,
>
> I am just trying to learn SQL, if u can help.
>
> I have Emp Table with the following 3 colomns
> ename, Salary, Dept No.
>
> Question:
> the statement:
> SQL> Select 'Name: ' || ename "Employee", Salary "Salary"
> From emp
> where deptno = 30
> order by deptno Desc, "Employee"
>
> Why || is used here ???
> why 'Name: ' is used here, it is not a column Name.???
>
> thanks
>
> Imen

The '||' is the concatenation operator, so instead of selecting just the ename column's value, the query is pre-pending 'Name: ' to the value:

Your query results will look something like:

Employee Salary

Name: George  10000.0
Name: Sally   12000.0
Name: William 11000.0

...

Yours,

Geoff Houck

systems hk
http://members.home.net/houckg
hksys_at_home.com Received on Sun Jun 24 2001 - 16:57:02 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US