Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Query Help?

Author  Topic 

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2001-07-23 : 13:36:05
I have an Employees Table with
EmpNum, EmpName, EmpID, Manager, isAdmin

I also have a variable holding the current employee logged in to the system.
This system only allows managers to log in.

So if I want to get a list of Employees for that manager I do:

SELECT Employees.EmpNum, Employees.EmpNum
FROM Employees INNER JOIN Employees As Employees2 ON Employees.Manager = Employees2.EmpName
WHERE Employees2.EmpID = '123'

How do I extend this query to show all the Employees if it's an Admin ( isAdmin = 1)

   

- Advertisement -