SQL Select all in the table that have the same identifier as ".."
Basically, I have a table of support users and there are different users of different levels in different departments.
So, let's say I basically have the following table:
id | userID | deptID | level
1 1 1 1
2 119 1 2
3 2 1 3
4 101 2 1
5 104 2 2
And I have a number id
, so let's say I want all users with the same deptID
as user in id
:, 3
returning the first three rows.
What will the SQL statement be?
+3
source to share
5 answers