Re: Need query

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Need query
Date: 2014-04-11 17:39:10
Message-ID: 1397237950480-5799694.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Gaurav Jindal wrote
> a has relation with b and b has relation with c

Given this statement what specifically are you having difficulty with. You
are allowed to perform multiple joins, whether explicit or via FROM/WHERE,
in the same query.

SELECT ...
FROM a,b,c
WHERE a=b and b=c

OR

SELECT ...
FROM c
JOIN b on c=b
JOIN a ON b=a

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Need-query-tp5799681p5799694.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

  • Need query at 2014-04-11 16:18:37 from Gaurav Jindal

Browse pgsql-general by date

  From Date Subject
Next Message Susan Cassidy 2014-04-11 17:50:50 Problem with query
Previous Message Andy Colson 2014-04-11 17:16:12 Re: efficient way to do "fuzzy" join