where clauses

From: "paul butler" <paul(at)entropia(dot)co(dot)uk>
To: pgsql-novice(at)postgresql(dot)org
Subject: where clauses
Date: 2002-10-17 13:10:15
Message-ID: T5dff17b117ac1785ed21a@pcow035o.blueyonder.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Thanks Rob,
original sees orgname as ambiguous so a little aliasing does nicely

SELECT u1.orgname
FROM users AS U1 INNER JOIN users AS U2 ON
U1.orgname = U2.orgname
WHERE U1.usertype='Drug Addiction' AND
U2.userType='Alcohol Addiction'

The only trouble is that it's going to require about 20 joins now to
handle all the attributes. But that's life.

An 'or' clause returns results from either condition so not applicable

Cheers

Paul Butler

Browse pgsql-novice by date

  From Date Subject
Next Message Jules Alberts 2002-10-17 13:21:21 Re: char() or varchar() for frequently used column
Previous Message Erwan DUROSELLE 2002-10-17 12:57:45 Rép. : where clauses with and