I have a query that I have to build that I need help with. Here is the basics of the query (? is where I need the help).
SELECT ? AS ManagerName
ManagerName needs to be pulled from one of two tables. If the ManagerID in the Employee Table is > 0, the Manager Name is retrieved using this query:
SELECT LastName || ', ' || FirstName FROM Employee WHERE EmployeeID = ManagerID
If the ManagerID in the Employee Table is < 0, the Manager Name is retrieved using this query:
SELELCT TeamName FROM OpenTeam WHERE OpenTeamID = ManagerID
If the ManagerID is 0, the Manager Name should be 'NONE'.
I don't know how to replace the ? with the queries to generate the ManagerName. Any help is greatly appreciated!