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

From: Paul Linehan <linehanp(at)tcd(dot)ie>
To: Ken Benson <Ken(at)infowerks(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Join three tables and specify criteria... I know this should be easy!
Date: 2014-08-29 17:41:31
Message-ID: CAF4RT5QmLHXDOkrO0WhgmrBt4OKKaHzXMM0Y4Fxzk9EXdvVyfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi Ken and, again, thanks for your input,

2014-08-29 18:11 GMT+01:00 Ken Benson <Ken(at)infowerks(dot)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(at)tcd(dot)ie

Mob: 00 353 86 864 5772

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Merlin Moncure 2014-08-29 17:47:42 Re: showing weekdays of dates
Previous Message Jude DaShiell 2014-08-29 17:39:12 showing weekdays of dates