where clauses - Mailing list pgsql-novice

From paul butler
Subject where clauses
Date
Msg-id T5dff17b117ac1785ed21a@pcow035o.blueyonder.co.uk
Whole thread Raw
List 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

pgsql-novice by date:

Previous
From: "Erwan DUROSELLE"
Date:
Subject: Rép. : where clauses with and
Next
From: "Jules Alberts"
Date:
Subject: Re: char() or varchar() for frequently used column