Skip to content

Commit

Permalink
Update code.md
Browse files Browse the repository at this point in the history
  • Loading branch information
datahubber authored Aug 10, 2023
1 parent 988e8ca commit de54b44
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions SQL/Advanced Select and Joins/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@ FROM Employees e
WHERE
salary < 30000 AND manager_id NOT IN (select employee_id from employees as c)
order by employee_id

select
employee_id,
department_id
from employee
where primary_flag = "Y"
union
select
employee_id,
department_id
from employee
group by employee_id
having count(employee_id) = 1

0 comments on commit de54b44

Please sign in to comment.