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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-novice by date

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