Re: Inner join syntax - Mailing list pgsql-novice

From Chad Thompson
Subject Re: Inner join syntax
Date
Msg-id 039e01c27143$73704400$32021aac@chad
Whole thread Raw
In response to Re: Inner join syntax  ("Josh Berkus" <josh@agliodbs.com>)
List pgsql-novice
Sometimes i cant see the trees for the forest. :-)

Thanks Josh, I was making it too complicated

Chad

----- Original Message -----
From: "Josh Berkus" <josh@agliodbs.com>
To: "Chad Thompson" <chad@weblinkservices.com>; "pgsql-novice"
<pgsql-novice@postgresql.org>
Sent: Friday, October 11, 2002 10:24 AM
Subject: Re: [NOVICE] Inner join syntax


> Chad,
>
> > select distinct on (l.full_phone) l.full_phone, l.id
> > from lists l inner join timezone tz on l.area_code = tz.area_code
> > inner join tiers t on phonenum_substr(l.full_phone) = t.npanxx
> > where l.client_id = 16
> > and l.list_of_lists_id = 170
> > and tz.greenwich = '-7'
> > and t.tier in ('A','B')
> >
> > I am trying to add the following restriction to the above query.  And
> > I'm lost some where.
> >
> > where not exists (
> > select cr.phonenum
> > from call_results cr
> > where client_id = 16
> > and l.full_phone = cr.phonenum)
>
> You're gonna feel silly ... you just need to replace the second "WHERE"
> with an "AND", i.e. ...
>
> AND NOT EXISTS (
> SELECT cr.phonenum ...
>
> -Josh Berkus
>
>
>


pgsql-novice by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: Inner join syntax
Next
From: "Kirby Krueger"
Date:
Subject: Problems with c, compiling, libraries