Please can you upload end to end ML videos that's what we are waiting for?
@nischalsubedi9432Ай бұрын
This solution is way too complicated with multiple joins which I do not think is that intuitive. Here is a simple query that can get to the same answer: WITH friends_count AS ( SELECT user_id1, COUNT(*) as no_of_friends FROM Friends GROUP BY user_id1 ) SELECT f.user_id1, f.user_id2 FROM Friends f JOIN friends_count fc ON f.user_id1 = fc.user_id1 WHERE fc.no_of_friends = 1;