Re: Extend inner join to fetch not yet connected rows also

2019-09-22 Thread Michael Lewis
Just a side note, that the below can be written more simply- CASE WHEN UserSkills.craftsmanship_id IS NULL THEN FALSE ELSE TRUE as has If you want to be direct- UserSkills.craftsmanship_id IS NOT NULL as has

Re: Extend inner join to fetch not yet connected rows also

2019-09-22 Thread Jan Kohnert
Hi Arup, Am Sonntag, 22. September 2019, 15:30:38 CEST schrieb Arup Rakshit: > When someone adds a craftsmanship to their skill set, the contractor_skills > table holds that relationship. I don’t think distinct is the correct tool, > as it will eliminate the correct data. users and craftsmanship

Re: Extend inner join to fetch not yet connected rows also

2019-09-22 Thread Adrian Klaver
On 9/22/19 6:30 AM, Arup Rakshit wrote: On 22-Sep-2019, at 6:55 PM, Jan Kohnert wrote: Hi Arup, Am Sonntag, 22. September 2019, 14:48:20 CEST schrieb Arup Rakshit: Hi Jan, On 22-Sep-2019, at 5:38 PM, Jan Kohnert wrote: maybe something like select c.id, c.name, case when

Re: Extend inner join to fetch not yet connected rows also

2019-09-22 Thread Arup Rakshit
> On 22-Sep-2019, at 6:55 PM, Jan Kohnert > wrote: > > Hi Arup, > > Am Sonntag, 22. September 2019, 14:48:20 CEST schrieb Arup Rakshit: >> Hi Jan, >> >>> On 22-Sep-2019, at 5:38 PM, Jan Kohnert >>> wrote: >>> maybe something like >>> >>> select >>> >>> c.id, >>> c.name, >>> case

Re: Extend inner join to fetch not yet connected rows also

2019-09-22 Thread Jan Kohnert
Hi Arup, Am Sonntag, 22. September 2019, 14:48:20 CEST schrieb Arup Rakshit: > Hi Jan, > > > On 22-Sep-2019, at 5:38 PM, Jan Kohnert > > wrote: > > maybe something like > > > > select > > > >c.id, > >c.name, > >case when cs.user_id = 8 then true else false end as has > > > > from

Re: Extend inner join to fetch not yet connected rows also

2019-09-22 Thread Arup Rakshit
Hi Jan, > On 22-Sep-2019, at 5:38 PM, Jan Kohnert > wrote: > > 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

Re: Extend inner join to fetch not yet connected rows also

2019-09-22 Thread Arup Rakshit
Hi Jan, I was close and came up with: SELECT craftsmanships.id, craftsmanships.name, CASE WHEN contractor_skills.user_id IS NULL THEN FALSE ELSE TRUE END AS has FROM "craftsmanships" LEFT JOIN

Re: Extend inner join to fetch not yet connected rows also

2019-09-22 Thread Jan Kohnert
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

Extend inner join to fetch not yet connected rows also

2019-09-22 Thread 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. What I want here is that to list all the available craftsmanships with id, name and has