pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dorthe Luebbert <dorthe@luebbert.net>
To: pgsql-sql@hub.org
Cc: luebbert@globalpark.de
Subject: Join-Question
Date: Sun, 23 Jan 2000 18:38:55 +0000
Message-ID: <200001231739.MAA63767@hub.org> (raw)
In-Reply-To: <200001231725.MAA59152@hub.org>

Hi,

I have a problem retrieving information from serveral 
different tables.

For example:

I have three tables:

Table 1 contains that person X has the hobby nr. 1, person 2 has 
hobby nr 42 etc (fields: person_id, hobby_nr)
Table 2: Hobby nr 1 is "soccer", hobby nr 2 is "jazz" (fields: 
hobby_nr, hobby_text) Table 3 contains the  first and last name for 
the persons in table nr 1 (fields person_id, first_name, last_name).

Now I want to find out for example the following:

If someone looks for a hobby, find out the first and last name of 
those who like hobby nr 1. If someone does not look for hobby, just 
print out all the names in the database.

In MySQL I would do something like a LEFT JOIN, wouldn´t I? But in 
Postgres I could not find anything about left or right joins. Any 
idea how to solve this problem??

Thanx so much for your help

 Dorthe



view thread (22+ messages)  latest in thread

Message-ID: <200001231739.MAA63767@hub.org>
Permalink:  ../200001231739.MAA63767@hub.org/
Also on:    postgresql.org/message-id/200001231739.MAA63767@hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dorthe@luebbert.net, pgsql-sql@hub.org, luebbert@globalpark.de
  Subject: Re: Join-Question
  In-Reply-To: <200001231739.MAA63767@hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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