Combining output of several fields in SQL query

From: Allan Kamau <kamauallan(at)yahoo(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Combining output of several fields in SQL query
Date: 2006-09-12 18:29:40
Message-ID: 20060912182941.4129.qmail@web53508.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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).

Allan.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Aaron Bono 2006-09-12 19:07:22 Re: Combining output of several fields in SQL query
Previous Message Mr. Dan 2006-09-12 17:42:13 COPY FROM command v8.1.4