Skip to content

Tag: greatest-n-per-group

Get the last entered id from a table in sql

enter image description hereI have an employee table. In that table I have n number of loan.. Now I want to select all the employees with his last taken loan value and date.. can anyone help me out in this. There’s what I’ve done so far: I tried group by, limit and order by for this but of no use&…

Why this select selects no rows

I am trying to select a highest earner in ‘IT’ department, but I keep selecting no rows. Salary and names are in table called employees while department_name is in a table named departments. Can anyone please explain why does this select no rows and how should I do it? Answer Why this select selec…