why distinct in this case doesn't work same as group by
Just want to know when I use DISTINCT instead of GROUP BY clause, I got 24 row which has to be 20 as we use GROUP BY but why this doesn't work here
Code I used:
m.emp_no, m.dept_no, d.dept_name
dept_manager_dup m ON d.dept_no = m.dept_no
-- GROUP BY emp_no
ORDER BY dept_no;
Thanx again for answering
Thanks for reaching out.
Could you please provide further explanation to your question? Are you asking about the differences between the
GROUP BY clause and the
DISTINCT keyword? Thank you.
Looking forward to your answer.
Actually yes also the code provided above I use both group by and distinct where group by works perfectly and provide me unique rows while distinct doesn't which i supposed to do soo.