Inner join syntax

Поиск
Список
Период
Сортировка
От Chad Thompson
Тема Inner join syntax
Дата
Msg-id 038d01c2713e$a616fa70$32021aac@chad
обсуждение исходный текст
Ответы Re: Inner join syntax  ("Josh Berkus" <josh@agliodbs.com>)
Список pgsql-novice
I have a query:
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)
 
In case its not clear I want the first query but dont want those numbers that are in call_results
 
Any Ideas?
 
TIA
Chad

В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Minimum permissions required for pg_dump as a backup user
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Re: Inner join syntax