Re: Join three tables and specify criteria... I know this should be easy! - Mailing list pgsql-novice

From Paul Linehan
Subject Re: Join three tables and specify criteria... I know this should be easy!
Date
Msg-id CAF4RT5S4g8uaSk-AtEhLhMp1KSaDPbRizLf4LxwVGt67eKvoMQ@mail.gmail.com
Whole thread Raw
In response to Re: Join three tables and specify criteria... I know this should be easy!  (Naresh Kumar <narain337@gmail.com>)
List pgsql-novice



2014-08-29 18:05 GMT+01:00 Naresh Kumar <narain337@gmail.com>:


Hi Naresh, and thanks for that,


> SELECT ul_user_id, user_name
> FROM user_language ul
> INNER JOIN language l ON ul.ul_iso_code = l.iso_code
> INNER JOIN user u ON u.user_id = ul.ul_user_id
> where l.language_name IN ('English', 'German')
> group by ul_user_id, user_name having COUNT(*) > 1


This gives the correct answer - however, I am just wondering what will I
do if I wish to specify just 'EN' say, or just 'DE'? Sometimes one
language is sufficient and we only need people who speak one
language - your query won't pick them up. Any ideas?

(My apologies BTW for not having included that in my original
spec :-) ).

Paul...


> -Naresh



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

pgsql-novice by date:

Previous
From: Ken Benson
Date:
Subject: Re: Join three tables and specify criteria... I know this should be easy!
Next
From: Jude DaShiell
Date:
Subject: showing weekdays of dates