I’m having difficulty with this problem.
I have a table with this structure:
OrderID | Manager | Worker
1 | John | Sally
2 | Tim | Kristy
I need a SQL query to get a result set like this:
OrderID | Employee
1 | John
1 | Sally
2 | Tim
2 | Kristy
Is this possible to perform?
Simplest way I can think of is (assuming you don’t care if Tim is listed before or after Kristy):
If order matters, and you want manager first always, then: