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] Using substr with user defined types

2000-06-22 Thread Tom Lane
[EMAIL PROTECTED] (D'Arcy J.M. Cain) writes: > Any ideas? Not with that much info. Sooner or later you're going to have to show us your C code... regards, tom lane

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

Re: [SQL] Using substr with user defined types

2000-06-22 Thread D'Arcy J.M. Cain
Thus spake Tom Lane > [EMAIL PROTECTED] (D'Arcy J.M. Cain) writes: > > create function chkpass_rout(opaque) > > returns opaque > > as '/usr/pgsql/modules/chkpass.so' > > language 'c'; > > > Here is what happens. > > > soccer=> select chkpass_rout('hello'::chkpass); > > ERROR: typeid

Re: [SQL] timespan casting

2000-06-22 Thread Ed Loehr
Jeff MacDonald wrote: > bignose=> select start,stop, stop-start as start_stop from foo; > start | stop | start_stop > ++ > 2000-06-22 20:37:12-03 | 2000-06-22 20:37:12-03 | 00:000 > > now my question.

[SQL] Re: [GENERAL] Sequences do not obey transactions...

2000-06-22 Thread Ryan Kirkpatrick
On Wed, 21 Jun 2000, Haroldo Stenger wrote: > This issue has been asked & answered MANY times, once a week perhaps. I'll copy > here what a folk answered once Hmm.. Then if the email archive searchs on the web site had been working I would not have had to was the list's time. A

[SQL] timespan casting

2000-06-22 Thread Jeff MacDonald
hi, thought this up while playing with time spans.. here is my table and data.. bignose=> \d foo Table "foo" Attribute | Type| Modifier ---+---+-- start | timestamp | stop | timestamp | bignose=> select start,stop, stop-start as start_sto

Re: [SQL] eliminating duplicates in results..

2000-06-22 Thread Jesus Aneiros
SELECT DISTINCT On Wed, 21 Jun 2000, Francisco Hernandez wrote: > hello everyone, > i have a query like so: > > select item.type as ig_id,item.with_design,item_group.type as > group_name, 'true' as valid from item,item_group where item.description > ~* 'w/out' and item.type = item_group.ig_id;

Re: [SQL] Wildcard in date field???

2000-06-22 Thread Ed Loehr
Web Manager wrote: > > I need to make a query that will select items that have a date matching > the current month for example. > > For June this means that any day between 2000-06-01 and 2000-06-30 are > ok. To do that I need a wildcard like "%" to replace the actual day in > the date field. >

Re: [SQL] Wildcard in date field???

2000-06-22 Thread Dorin Grunberg
SELECT * FROM my_table WHERE date_part('month', col_name::datetime) = '06' AND date_part('year', col_name::datetime) = '2000'; Looks for more detail in the manual for "date_part" Dorin At 03:52 PM 6/22/2000 -0400, Web Manager wrote: >Hello, > >I need to make a query that will select items t

[SQL] Wildcard in date field???

2000-06-22 Thread Web Manager
Hello, I need to make a query that will select items that have a date matching the current month for example. For June this means that any day between 2000-06-01 and 2000-06-30 are ok. To do that I need a wildcard like "%" to replace the actual day in the date field. Ex.: select * from item wh