Skip site navigation (1) Skip section navigation (2)

Re: Easy SQL Question

From: "Shoaib Mir" <shoaibmir(at)gmail(dot)com>
To: Greg <greg(at)officium(dot)co(dot)za>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Easy SQL Question
Date: 2006-06-12 09:01:44
Message-ID: bf54be870606120201ye70da55wd07e9e47ac71785d@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
You can do it like this:

select firstname || ' ' || lastname as fullname from emp;

/Shoaib

On 6/12/06, Greg <greg(at)officium(dot)co(dot)za> wrote:
>
> I Was looking at the PgSQL documentation last night but could not find how
> to join two fields as one,
>
> i.e
>
> select (firstname + lastname) as fullname from users
>
> I also tried (Cast(firstname as varchar) + Cast(lastname as varchar))
>
> But that doesn't work..
> How do I do this?
>
> Thanks
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

In response to

pgsql-novice by date

Next:From: A. KretschmerDate: 2006-06-12 09:15:28
Subject: Re: Question about stored procedures
Previous:From: GregDate: 2006-06-12 08:58:22
Subject: Easy SQL Question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group