Re: Combining output of several fields in SQL query

From: "Aaron Bono" <postgresql(at)aranya(dot)com>
To: "Allan Kamau" <kamauallan(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Combining output of several fields in SQL query
Date: 2006-09-12 19:07:22
Message-ID: bf05e51c0609121207u2951fb6dl970a7835f27e29db@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 9/12/06, Allan Kamau <kamauallan(at)yahoo(dot)com> wrote:
>
> Hi all,
> This is a plain simple sql question appologies for
> posting it here.
>
> Am looking for a way of combining values from several
> fields(and introducting value separators).
>
> select field2+"_"+field1 from tableA;
>
> I've tried
> select field2||'_'||field1 from tableA;
> I get "1" as the result(which is not what I want).

What does tableA look like (DDL and the data)?

==================================================================
Aaron Bono
Aranya Software Technologies, Inc.
http://www.aranya.com
http://codeelixir.com
==================================================================

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Mr. Dan 2006-09-12 19:16:27 COPY FROM command v8.1.4
Previous Message Allan Kamau 2006-09-12 18:29:40 Combining output of several fields in SQL query