Sobes.tech
Middle

Pasirinkite * Iš lentelės1 kaip t1 Kairysis jungimas su lentele2 kaip t2 ON t1.date_start > t2.date_start --DML Sukurkite lentelę, jei ji neegzistuoja Employee (id int, salary int, departmentId int); Įterpkite į Employee (id,salary,departmentId) reikšmes (1, 70000, 1),(2, 94000, 1),(3, 85000, 1),(4, 80000, 2),(5, 60000, 2),(6, 62000, 3),(7, 90000, 3),(8, 94000, 3),(9, 94000, 3); su cte kaip( pasirinkite *, rank() over(partition by departmentId order by salary desc) kaip max_salary iš Employee ) pasirinkite * iš cte kur max_salary = 1