Discussion:
joins INNER, OUTER, LEFT, RIGHT, FULL, ...
(too old to reply)
Roderick A. Anderson
2004-11-23 17:03:57 UTC
Permalink
Be gentle as I come from an Oracle background a long time ago.

I am trying to join several tables with a couple of tables having a one
to many relationship. I got one query working pretty well but the issue
comes about when I add one more table with a one-to-one relationship. I
get a semi/pseudo Cartesian join.

I'm not asking for the exact solution but a pointer to a _good_
reference on complex joins. My searching on the PostgreSQL site and
Google only turn up examples of simple joins. I did forget to look at
the two PostgreSQL books I have at home -- Bruce's and Practical
PostgreSQL -- last night so if there are some in them a light tap with
the clue-stick will suffice.


Thanks,
Rod
--
---
[This E-mail scanned for viruses by Declude Virus]


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ***@postgresql.org so that your
message can get through to the mailing list cleanly
Erwin Brandstetter
2004-11-24 15:44:56 UTC
Permalink
Post by Roderick A. Anderson
Be gentle as I come from an Oracle background a long time ago.
I am trying to join several tables with a couple of tables having a one
to many relationship. I got one query working pretty well but the issue
comes about when I add one more table with a one-to-one relationship. I
get a semi/pseudo Cartesian join.
I'm not asking for the exact solution but a pointer to a _good_
reference on complex joins. My searching on the PostgreSQL site and
Google only turn up examples of simple joins. I did forget to look at
the two PostgreSQL books I have at home -- Bruce's and Practical
PostgreSQL -- last night so if there are some in them a light tap with
the clue-stick will suffice.
You might be more successful with a concrete description of your problem.
As it stands all I can come up with is this:
http://www.postgresql.org/docs/7.4/static/sql-select.html

I would be interested in a more detailed look on complex JOINs myself,
especially regarding performance.


Regards
Erwin

Loading...