Re: Join three tables and specify criteria... I know this should be easy!

Поиск
Список
Период
Сортировка
От Ken Benson
Тема Re: Join three tables and specify criteria... I know this should be easy!
Дата
Msg-id 6a9d6f3cc01f456aa59bf7efdc60cbc5@BY2PR02MB028.namprd02.prod.outlook.com
обсуждение исходный текст
Ответ на Re: Join three tables and specify criteria... I know this should be easy!  (Paul Linehan <linehanp@tcd.ie>)
Ответы Re: Join three tables and specify criteria... I know this should be easy!  (Paul Linehan <linehanp@tcd.ie>)
Список pgsql-novice

I thought the user_id is all you wanted …

 

But - you only want the id/name for a person that speaks ALL of the languages specified?

 

Or any user that speaks ANY of the specified languages?

 

Or Id/name/languages spoken?

 

What is the exact output you're looking for?

 

Says,

 

Ken

 

 

 

 

From: Paul Linehan [mailto:linehanp@tcd.ie]
Sent: Friday, August 29, 2014 10:42 AM
To: Ken Benson
Cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] Join three tables and specify criteria... I know this should be easy!

 



Hi Ken and, again, thanks for your input,



2014-08-29 18:11 GMT+01:00 Ken Benson <Ken@infowerks.com>:

> Whoops:
> Should be WHERE ul. iso_code IN ('EN','DE')

but


SELECT DISTINCT u.user_id
FROM user u
JOIN user_language ul
ON u.user_id = ul.ul_user_id
JOIN language l
ON ul.ul_iso_code = l.iso_code
WHERE ul.ul_iso_code IN ('EN','DE');

gives

user_id
1
2

And see also my reply to Naresh about if there's only one
language required.

Paul...





--
 
linehanp@tcd.ie
 
Mob: 00 353 86 864 5772

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: showing weekdays of dates
Следующее
От: Csányi Pál
Дата:
Сообщение: Re: showing weekdays of dates