pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Using subselects as joins in POstgeSQL (possible?, examples)
2+ messages / 2 participants
[nested] [flat]

* Using subselects as joins in POstgeSQL (possible?, examples)
@ 2005-07-22 12:13  frank church <pgsql@adontendev.net>
  0 siblings, 1 reply; 2+ messages in thread

From: frank church @ 2005-07-22 12:13 UTC (permalink / raw)
  To: pgsql-sql



Is it possible to use subselects as joins in PostgreSQL.

eg.

select a.a, a.b, a.c, b.a, b.b. b.c from (first subsselect) a (second subselect)
b  where (in table criteria) and a.a = b.a

or

select a.a, a.b, a.c, b.a, b.b. b.c from (first subsselect) a join (second
subselect) b on a.a = b.a where (in table criteria)

I have a feeling it is possible but I need the right syntax

//Frank



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Using subselects as joins in POstgeSQL (possible?, examples)
@ 2005-07-22 13:21  Pascual De Ruvo <deruvo@gmail.com>
  parent: frank church <pgsql@adontendev.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Pascual De Ruvo @ 2005-07-22 13:21 UTC (permalink / raw)
  To: frank church <pgsql@adontendev.net>; +Cc: pgsql-sql

On 7/22/05, frank church <pgsql@adontendev.net> wrote:
> 
> 
> 
> Is it possible to use subselects as joins in PostgreSQL.


Absolutely.

select * from 
(select * from table1) as a, 
(select * from table2) as b 
where a.a = b.b

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2005-07-22 13:21 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-07-22 12:13 Using subselects as joins in POstgeSQL (possible?, examples) frank church <pgsql@adontendev.net>
2005-07-22 13:21 ` Pascual De Ruvo <deruvo@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox