Re: amateur nite out

George Young <gry@ll.mit.edu>

From: George Young <gry@ll.mit.edu>
To: "D. Duccini" <duccini@backpack.com>, Pgsql-novice <pgsql-novice@postgresql.org>
Date: 2001-01-03T14:29:42Z
Lists: 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