Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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


Paul Butler

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group