Re: [SQL] Merging two columns into one

2000-06-26 Thread Gary MacMinn
All, Many thanks for your thoughts on the merging of columns. The tr method would have killed all the delimiters as a few people noted. The || method in SQL was the winner, although the final table this has to be done to (4 million records) should kill the system for a while! Must make sur

Re: [SQL] Merging two columns into one

2000-06-23 Thread Jeff Hoffmann
"D'Arcy J.M. Cain" wrote: > > PostgreSQL could use a > phone number type. I have been meaning to write a user defined type > for some time but never seem to get around to it. Maybe you could > give this a shot. The examples in contrib should get you started. > Once finished you can make the ph

Re: [SQL] Merging two columns into one

2000-06-23 Thread D'Arcy J.M. Cain
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

Re: [SQL] Merging two columns into one

2000-06-23 Thread D'Arcy J.M. Cain
Thus spake Gary MacMinn > I have two columns in a table (areacode and phone number) that I'd like to merge >into one (phone number) containing both sets of info. Could anyone suggest a simple >way of achieving this? Oliver showed you how to merge these together with the SQL concatenate operator

Re: [SQL] Merging two columns into one

2000-06-22 Thread Oliver Elphick
Christopher Sawtell wrote: >On Fri, 23 Jun 2000, Gary MacMinn wrote: >> Hi All, >> >> I have two columns in a table (areacode and phone number) that I'd like to > merge >into one (phone number) containing both sets of info. Could anyone suggest a >simple way of achieving this?

Re: [SQL] Merging two columns into one

2000-06-22 Thread Christopher Sawtell
On Fri, 23 Jun 2000, Gary MacMinn wrote: > Hi All, > > I have two columns in a table (areacode and phone number) that I'd like to merge into one (phone number) containing both sets of info. Could anyone suggest a simple way of achieving this? export the data to a file using the copy command, rem

[SQL] Merging two columns into one

2000-06-22 Thread Gary MacMinn
Hi All, I have two columns in a table (areacode and phone number) that I'd like to merge into one (phone number) containing both sets of info. Could anyone suggest a simple way of achieving this? Thanks, Gary MacMinn