Re: Extend inner join to fetch not yet connected rows also
| От | Jan Kohnert |
|---|---|
| Тема | Re: Extend inner join to fetch not yet connected rows also |
| Дата | |
| Msg-id | 1780284.qfRisySgFs@kohni-mobil обсуждение исходный текст |
| Ответ на | Extend inner join to fetch not yet connected rows also (Arup Rakshit <ar@zeit.io>) |
| Ответы |
Re: Extend inner join to fetch not yet connected rows also
Re: Extend inner join to fetch not yet connected rows also |
| Список | pgsql-general |
Hey,
Am Sonntag, 22. September 2019, 13:21:46 CEST schrieb Arup Rakshit:
> I have craftsmanships table which has (id, name) and users table (id, email,
> ..). When a user has some craftsmanships, they are stored inside the
> contractor_skills(user_id, craftsmanship_id, id) table.
[...]
> But I want to list all craftsmanships and has column should have `t` when
> user_id #8 has it, else `f`. How can I extend this query?
maybe something like
select
c.id,
c.name,
case when cs.user_id = 8 then true else false end as has
from craftsmanships c
left join contractor_skills cs
on cs.craftsmanship_id = c.craftmanship_id;
--
MfG Jan
В списке pgsql-general по дате отправления: