ID Name Dept ExpiryDate 1 Rajesh IT 23-Jan-16 2 Keerthi CSE 23-Jan-16 3 Rajesh Mech 24-Jan-16 4 Venkat IT 28-Jan-16 5 VenKat IT 29-Jan-16 6 Priya CSE 30-Jan-16
Name IT CSE MECH Rajesh 23-Jan-16 24-Jan-16 Keerthi 23-Jan-16 Venkat 29-Jan-16 Priya 30-Jan-16
SELECT * FROM (SELECT Name, Dept, ExpiryDate FROM TestTable) a PIVOT ( MAX(ExpiryDate) FOR Dept in ([IT], [CSE],[Mech]) ) AS data
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)