How many rows that table has?Here is a methodDeclare @t table(UID int, NAME varchar(20),DATE datetime, STATUS char(10),INiTIALS char(3),DAYS int)insert into @t values(78, 'kijj', '23-may-2005', 'A', 'KJ', 23)insert into @t values(67, 'bob', '18-June-2005', 'A', 'b', 20)insert into @t values(78, 'kijj', '20-jun-2005', 'A', 'KJ', 0)insert into @t values(67, 'bob', '18-jun-2005', 'O', 'B', 20)insert into @t values(67, 'bob', '18-jun-2005', '', '', 23)Select Distinct UID,Name,(Select max(date) from @t where UId=T.UID),(Select max(Status) from @t where UId=T.UID),(Select max(Initials) from @t where UId=T.UID),(Select max(days) from @t where UId=T.UID) from @t T
MadhivananFailing to plan is Planning to fail