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

Re: Merging two columns into one

From: darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain)
To: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Cc: Christopher Sawtell <csawtell(at)xtra(dot)co(dot)nz>, Gary MacMinn <G(dot)MacMinn(at)nca(dot)gov(dot)au>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Merging two columns into one
Date: 2000-06-23 11:40:25
Message-ID: m135Rov-000AY5C@druid.net (view raw or flat)
Thread:
Lists: pgsql-sql
Thus spake Oliver Elphick
>   SELECT col1, col2,..., areacode || phone as phone, colx, coly,...

Although you may want this for easier reading.

SELECT col1, col2,..., (areacode || ' ') || phone as phone, colx, coly,...

Also, I would do "as fullphone" instead so that I don't get confused
between the field name and my generated string but that's mainly a
style issue.

-- 
D'Arcy J.M. Cain <darcy(at){druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.

In response to

pgsql-sql by date

Next:From: Vassili A AkimovDate: 2000-06-23 14:27:18
Subject: Need to improve performance
Previous:From: D'Arcy J.M. CainDate: 2000-06-23 11:35:37
Subject: Re: Merging two columns into one

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