Can anyone explain to me why my solution does not work? with Functions_symmetric as ( select Functions.y as x2, Functions.x as y2 from Functions ), Joined_tables as ( select Functions.x, Functions.y, Functions_symmetric.x2, Functions_symmetric.y2 from Functions inner join Functions_symmetric on Functions.x = Functions_symmetric.y2 and Functions.y = Functions_symmetric.x2 ) select distinct x, y from Joined_tables where x
@pujankoshti95897 ай бұрын
why you did GROUP BY X,Y in where clause?. what is the use of that?
@datasciencewithnish7 ай бұрын
General Context - We use the GROUP BY clause to categorize data before applying the HAVING clause. The GROUP BY clause groups rows together based on shared values in one or more columns. The HAVING clause then filters these groups based on a condition applied to aggregate functions (e.g., COUNT) in this case. Generally, HAVING allows filtering based on aggregate values, which aren't available until after the data is grouped. For instance, here you can't filter for symmetric pairs with a "COUNT > 1" until the rows are grouped and the count is calculated. So, we've used the GROUP BY just to segregate the pairs.
@frezerzelalem40176 ай бұрын
@@datasciencewithnish as a follow up, why didn't you used x1
@Anonymous____________A7214 ай бұрын
Why not cross join
@Mahanthesh.7 ай бұрын
Amazing madam
@shashanksingh47085 ай бұрын
Thanks for sharing your solution . Have a look at mine : select distinct f1.x , f1.y from functions f1 join functions f2 on f1.x=f2.y and f1.y=f2.x where f1.x
@rajeshin14 ай бұрын
Other way can be like this too right select distinct f1.x , f1.y from functions f1 join functions f2 on f1.x=f2.y and f1.y=f2.x where f1.x1 ) order by f1.x;
@palnitin256 ай бұрын
Thank you for this Nishtha
@SumanSadhukhan-md4dq6 ай бұрын
This is nice
@YogeshChaudhary-s8y5 ай бұрын
as a follow up, why didn't you used x1
@harshitgiria77095 ай бұрын
Did you understand why it's happening? Could you please let me know?
@coc33115 ай бұрын
okey actual problem is that when you use x1
@harshitgiria77095 ай бұрын
@@coc3311 Yeah Got it ...Thank You for the explanation.