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 |
|
maulikk2000
Starting Member
3 Posts |
Posted - 2011-03-07 : 06:40:27
|
| Hi,my question is, I've an employee table with three columns empid, empname and mgrid where employee can be a manager. I need to find all the employees who dont have a manager but who has atleast one employee assign to it..let me know how to achieve itthanks,Maulik |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2011-03-07 : 06:48:13
|
| Provide some CREATE TABLE scripts with some sample data and your expected output.- LumbagoMy blog-> http://thefirstsql.com/2011/02/07/regular-expressions-advanced-string-matching-and-new-split-function-sql-server-2008-r2/ |
 |
|
|
maulikk2000
Starting Member
3 Posts |
Posted - 2011-03-07 : 06:58:56
|
| CREATE TABLE [dbo].[Employee]( [EmpId] [int] not NULL, [MgrId] [int] NULL, [EmpName] [varchar](50) not NULL) Sample data is EmpId MgrId EmpName1 NULL Test2 NULL Test13 1 Test24 2 Test35 2 anow expected result is MgrID EmpName1 Test 2 Test1hope it makes sense..thanksMaulik |
 |
|
|
|
|
|