Re: amateur nite out - Mailing list pgsql-novice

From George Young
Subject Re: amateur nite out
Date
Msg-id 01010309453700.22945@pen
Whole thread Raw
In response to amateur nite out  ("D. Duccini" <duccini@backpack.com>)
Responses Re: amateur nite out
List pgsql-novice
On Tue, 02 Jan 2001, D. Duccini wrote:
> how do you select multiple columns but return them as a single column?
>
> ie, select lastname+', '+firstname as fullname from authors;
>
> of course it chokes on the + op

This needs to be double vertical bars, not plus signs:

    select lastname || ', ' || firstname as fullname from authors;

In psql, the "\do" command (list operators), shows:

 op |left_arg  |right_arg |result   |description
---+----------+----------+---------+-----------------------------------------
...
|| |text      |text      |text     |concatenate


--
George Young,  Rm. L-204        gry@ll.mit.edu
MIT Lincoln Laboratory
244 Wood St.
Lexington, Massachusetts  02420-9108    (781) 981-2756

pgsql-novice by date:

Previous
From: "D. Duccini"
Date:
Subject: Re: ColdFusion sez this is valid SQL
Next
From: "D. Duccini"
Date:
Subject: Re: amateur nite out