I have two tables:
Users Table:
ID | Name | UserGroupID |
1 | John | 2
2 | Sam | 11
3 | Kiddo | 2
4 | Sony | 3
5 | Jabeen | 1
UsersMachine Table:
ID | MachineID | EmpID
1 | 1 | 1
2 | 2 | 1
3 | 1 | 2
4 | 2 | 2
5 | 2 | 4
6 | 3 | 5
i m looking at single sql to repeat all Users by filtering
FROM UserMachine WHERE MachineID = 2 ALSO FROM Users WHERE UsersGroupID IN (2,11) with these conditions
I m looking at following reasults:
MachineID | UsersName | UsersGroupID
2 | John | 2
2 | Sam | 11