Re: Simplyfying many equals in a join - Mailing list pgsql-general

From cnliou
Subject Re: Simplyfying many equals in a join
Date
Msg-id 1077788242.37142.cnliou@so-net.net.tw
Whole thread Raw
In response to Simplyfying many equals in a join  (Randall Skelton <skelton@brutus.uwaterloo.ca>)
Responses Re: Simplyfying many equals in a join
List pgsql-general
>Is there a shorthand notation when performing a multi-table join and one
>column is to be equaled in all tables?

Is this you are looking for?

SELECT t1.c7,t2.c6
FROM t1,t2
USING (c1,c2,c3)
WHERE t1.c4='2004-2-28' AND t2.c5='xyz'

performs the same as

SELECT t1.c7,t2.c6
FROM t1,t2
WHERE t1.c1=t2.c1 and t1.c2=t2.c2 and t1.c3=t2.c3
and t1.c4='2004-2-28' AND t2.c5='xyz'

CN

pgsql-general by date:

Previous
From: Shachar Shemesh
Date:
Subject: Re: Windows Library for libpq
Next
From: "Jennifer Lee"
Date:
Subject: help using arrays in a function