Hi,Here is the sample tablecreate table #temp(status varchar(10),paxId int,sellingItemID int)goinsert into #tempselect ' Old', 9, 111 union allselect ' New', 9, 111 union allselect ' New', 8, 112 union allselect ' New', 10, 112 union allselect ' Old', 9, 113 union allselect ' New', 9, 113 union allselect ' Old', 9, 114 union allselect ' New', 9, 114 union allselect ' Old', 9, 115 union allselect ' New', 9, 115 union allselect ' New', 10, 115 union allselect ' Removed ',11, 114 union allselect ' Removed ',9, 116 goselect * from #tempexpectd output:status paxId sellingItemID Old 9 111 New 9 111 New 8 112 New 10 112 Old 9 113 New 9 113 Old 9 114 New 9 114 Old 9 115 New 9 115 New 10 115 Removed 11 114 Removed 9 116
Thanks,--Ranjit