From: | "paul butler" <paul(at)entropia(dot)co(dot)uk> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | where clauses with and |
Date: | 2002-10-17 12:42:52 |
Message-ID: | T5dfefe9b20ac1785c30d4@pcow058m.blueyonder.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Here's an odd one:
I can't seem to make a where clause containing 'and' work
db=# select orgname,usertype from users where usertype='Drug
Addiction';
orgname | usertype
------------------------------------+----------------
Turning Point Scotland | Drug Addiction
Govan Youth Access Project | Drug Addiction
Community Learning West Team | Drug Addiction
Possil Learning Centre | Drug Addiction
Langside College (Glenwood Campus) | Drug Addiction
Rehab Remanufacturing Services Ltd | Drug Addiction
Greater Pollok Addiction Service | Drug Addiction
db=# select orgname,usertype from users where usertype='Alcohol
Addiction';
orgname | usertype
------------------------------------+-------------------
Possil Learning Centre | Alcohol Addiction
Greater Pollok Age Concern | Alcohol Addiction
Rehab Remanufacturing Services Ltd | Alcohol Addiction
Greater Pollok Addiction Service | Alcohol Addiction
db=# select orgname from users where usertype='Alcohol
Addiction' and usertype ='Drug Addiction';
orgname | usertype
---------+----------
(0 rows)
I would expect orgnames:
Greater Pollok Addiction Service,
Rehab Remanufacturing Services Ltd
to be returned.
Any idea where I'm going wrong?
Cheers
Paul Butler
From | Date | Subject | |
---|---|---|---|
Next Message | matt | 2002-10-17 12:46:07 | unsubscribe remove |
Previous Message | paul butler | 2002-10-17 12:28:55 | Re: char() or varchar() for frequently used column |