Last answered:

26 Apr 2023

Posted on:

18 Feb 2023

0

Exercise 1: Solution

select     dm.emp_no, 
        dm.dept_no, 
        dm.from_date, 
        dm.to_date, 
        s.salary, 
        row_number() over() as row1, /*why isn't this correct for this part of the question "a column containing the row number of each row from the obtained dataset, starting from 1."?*/
        row_number() over(partition by dm.emp_no order by s.salary DESC) as row2
from dept_manager dm 
    join salaries s 
    on dm.emp_no = s.emp_no;



1 answers ( 0 marked as helpful)
Instructor
Posted on:

26 Apr 2023

0

Hi Cyd-Marie!
Thanks for reaching out.


It seems that your code is correct. You start counting from 1 with your code.


Hope this helps.
Best,
Tsvetelin

Submit an answer