Typical one. Thanks for sharing sir.. You are genuine one sir.. In the market these type of questions are being sold for thousands by learning courses. Please start some free courses or write a book for 100 data engineer questions. I will surely take it up sir.
Please let me know this work or not select e1.department_id,e1.employee_id,e1.name,count(*) from employees e1 cross join employees e2 where e1.department_id =e2.department_id and e1.employee_id >=e2.employee_id group by 1,2,3 order by e1.department_id,e1.employee_id;
Thanks for the new approach...
Select *, count(*) over(partition by department_id order by employee_id) as rnk
from empl;
Typical one. Thanks for sharing sir.. You are genuine one sir.. In the market these type of questions are being sold for thousands by learning courses. Please start some free courses or write a book for 100 data engineer questions. I will surely take it up sir.
Thank you
I use other window function
SELECT *,DENSE_RANK()over(partition by department_id order by name) as rn FROM employees
order by employee_id
Nice, but intention was to not use any window functions.
You also confuse we use order by again remove
Where?
Please let me know this work or not
select e1.department_id,e1.employee_id,e1.name,count(*) from employees e1 cross join employees e2 where e1.department_id =e2.department_id and
e1.employee_id >=e2.employee_id group by 1,2,3 order by e1.department_id,e1.employee_id;
No, it will not work. It will give you syntax error
Not understand
Please watch the video again for better understanding