Last answered:

22 May 2024

Posted on:

13 Feb 2023

0

Assignment (Excercise #1)

I am sorry but I did not get what is meant by 'disregard the department the managers have worked in'

I firstly got that we are required to get the last department each manager is working in so my solution was 

SELECT 
   emp_no, dept_no, max(from_date),
   row_number() over (order by emp_no) as row_num
FROM
    dept_manager
GROUP BY dept_no;

while the excercise solution is not like that 

3 answers ( 0 marked as helpful)
Posted on:

13 May 2023

0

select emp_no,dept_no,
row_number() over(order by emp_no asc) as row_num
from dept_manager
;

Posted on:

13 May 2023

0

Instructor
Posted on:

22 May 2024

0

Hi Eslam and Partha!

Thanks for reaching out!


@: Partha

Thanks for sharing information with the Community! 

@: Eslam

Please, use the code suggested by Partha. The idea is to just count the managers from 1 to 24 using the ROW_NUMBER() function.


Hope this helps.
Best,
Martin

Submit an answer