我们如何为以下要求编写一个很好的查询。
我有一个employee
表,它有 3 列
1. Employee ID
2. ManagerID
3. LocationID
我想返回首先返回的输出(1 或 2 或 3 或 4 或无)。以下是附加条件。
1. EmployeeID = 1233 and ManagerID = 2222 and LocationID = 3333
2. EmployeeID = 1233 and ManagerID is null and LocationID = 3333
3. EmployeeID = 1233 and ManagerID = 2222 and LocationID = 3333
4. EmployeeID = 1233 and ManagerID is null and LocationID is null
我想有这样的逻辑。谁能帮我查询一下。