Re: [SQL] Problem with coalesce..

2000-11-01 Thread Continuing Technical Education
Try:   SELECT COALESCE(CURVALUE,1) FROM TABLEKEYS WHERE TABLENAME = 'BUYER';   - Original Message - From: George Henry C. Daswani To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, October 31, 2000 5:52 PM Subject: [SQL] Problem with coalesce..

Re: [SQL] Conditional query plans.

2000-10-20 Thread Continuing Technical Education
> update users set enabled='f',disablereason='We do not allow our > system to be used for SPAM.' where id in (select id from users where > loginid in (select distinct loginid from logins where > ip='123.123.12.12')); Would it run better as: update users set enabled='f',disablereason='We do not a

Re: [SQL] problem with date

2000-07-10 Thread DalTech - Continuing Technical Education
Try NULL rather than ''. '' is not a null in postgres. - Original Message - From: Shalini shikha <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 10, 2000 3:15 PM Subject: [SQL] problem with date > How can I insert/update a null value in a date field. If a try a sql > s

Re: [SQL] MAX() of 0 records.

2000-07-07 Thread DalTech - Continuing Technical Education
> UPDATE entry_stats > SET entry_maxprice=MAX(item_price) > FROM item > WHERE item.item_entry_id=NEW.item_entry_id > AND item.item_live = 't'; Try COALESCE(MAX(item_price),0) Christopher J.D. Currie Computer Technician Dalhousie: DalTech - CTE _

Re: [SQL] Running queries from scripts.

2000-07-06 Thread DalTech - Continuing Technical Education
> It works for me, for example, this way: > athens% psql -d template1 -c "select datname from pg_database" Thanks, I feel a little sheepish at not trying it with quotes around the query, but the manuals don't mention that you have to enclose the query in quotes when you use the -c option. -Chris

[SQL] Running queries from scripts.

2000-07-06 Thread DalTech - Continuing Technical Education
I was wondering if anyone could help me out with the syntax of running queries from a unix script.   psql -c select 'I am a dummy' -d dbname  - never seems to work.  I've tried variations on the command line, but to no success.   Does the -c option work?   Cheers, Christopher Currie _

Re: [SQL] Re: unique sequences

2000-06-27 Thread DalTech - Continuing Technical Education
I imagine it should if you create a unique index on the field. Cheers, Christopher Currie - Original Message - From: K Parker <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 27, 2000 1:52 AM Subject: [SQL] Re: unique sequences > > Rather, each time you wish to do an in

[SQL] Does anyone know of a function equivilant to Oracle's decode function?

2000-06-20 Thread DalTech - Continuing Technical Education
I have not seen much information about this anywhere on the web.   If anyone has seen, or written a function similar, could you please let me know where?   Thanks.