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.
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | Natalia89Starting Member
 
 
                                        12 Posts | 
                                            
                                            |  Posted - 2013-12-04 : 16:25:56 
 |  
                                            | I have a table that contains empid, name, salary, hiredate, positionand supervisor (which includes empid not the name) how do i list the empid and name of all supervisors ? the output has to have to columns supervisor( and a list of their emid) and their names. Thats the create statement used to create the employee table:/* Create table Employee */IF OBJECT_ID('Employee', 'U') IS NOT NULL  DROP TABLE EmployeeGOCREATE TABLE Employee (emp_id NCHAR(5), name NVARCHAR(20), position NVARCHAR(20),hire_date DATETIME,salary MONEY, bcode NCHAR(3),supervisor NCHAR(5))i have tried a variety of statements using having statement and count but the dont seem to work:/select emp_id, name from employee where position='manager'; i tried this but it doesnt work anoune smart that knows how to do it? saddf |  |  
                                    | TGMaster Smack Fu Yak Hacker
 
 
                                    6065 Posts |  |  
                                |  |  |  |