Corey,do you know about any performance difference between method 1, 2 below ?create Table #myTable(empId int, empName varchar(100), taskId int)Insert Into #myTableSelect 1, 'raj', 232Union All Select 1, 'john', 566Union All Select 2, 'johny', 898Union All Select 3, 'lee', 787Union All Select 3, 'kaer', 788-- 1Select a.empId, a.empName, a.taskId From #myTable aWhere 0 = ( Select count(*) From #myTable Where empId = a.empId and empName < a.empName )-- 2select a.empId, a.empName, a.taskIdfrom #myTable a join ( select empId, min(empName) as empName from #myTable group by empId ) grp on a.empId = grp.empId and a.empName = grp.empName
rockmoose/* Chaos is the nature of things...Order is a lesser state of chaos */