| 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 20:08:35 |
| Message-ID: | bf05e51c0609121308n49967bddn21d7379bf4edde5f@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-admin |
On 9/12/06, Allan Kamau <kamauallan(at)yahoo(dot)com> wrote:
>
> create table tableA(
> s_l_p_p_v_i text not null,
> field1 text not null,
> field2 text not null,
> primary key(field1,field2));
>
> s_l_p_p_v_i field1 field1
> abc 2 1
> xyz 2 4
> klm 2 3
Your initial query:
select field2||'_'||field1 from tableA;
works perfectly for me:
?column?
4_2
1_2
3_2
Are you sure you are not getting the correct results?
==================================================================
Aaron Bono
Aranya Software Technologies, Inc.
http://www.aranya.com
http://codeelixir.com
==================================================================
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Mr. Dan | 2006-09-12 20:32:49 | COPY FROM command v8.1.4 |
| Previous Message | Fernando Machado | 2006-09-12 19:40:17 | Data Synch |