Re: Table joining problem. - Mailing list pgsql-novice

From Giles Lean
Subject Re: Table joining problem.
Date
Msg-id 20010528123331.22067.qmail@nemeton.com.au
Whole thread Raw
In response to Table joining problem.  (GCS <gcs@c64.rulez.org>)
List pgsql-novice
>  I am not really novice, but not good either. I have a problem if the
> table is empty, my select does not return anything then.
> I have three tables,
> 1. users(nick varchar(),number int serial)
> 2. teams(owner references users)
> 3. challange(who references users)
> I want to get all the users, who has a team, but not yet in the challange
> table:

Perhaps:

select user.nick, users.number from users, teams
  where users.number = teams.owner and
  not exists (select * from challenge where challenge.who = users.number);

Regards,

Giles

pgsql-novice by date:

Previous
From: Milen
Date:
Subject: batch file
Next
From: Nabil Sayegh
Date:
Subject: Re: inserting values like in mySQL