Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Replace Rows with other in same table

$
0
0
I have the below table :ID Name Date_Start Date_End Time_Start Time_End9 xxxxx@gmail.com 13/06/2015 NULL 23:00.0 NULL10 xxxxx@gmail.com NULL 14/06/2015 NULL 00:00.011 xxxxx@gmail.com 15/06/2015 NULL 00:00.0 NULL12 xxxxx@gmail.com NULL 15/06/2015 NULL 00:00.013 xxxxx@gmail.com 14/06/2015 NULL 00:00.0 NULL14 xxxxx@gmail.com NULL 14/06/2015 NULL 00:00.0Then i need to replace second row with value with first row with null and so on :ID Name Date_Start Date_End Time_Start Time_End9 xxxxx@gmail.com 13/06/2015 14/06/2015 23:00.0 00:00.010 xxxxx@gmail.com NULL NULL NULL NULL11 xxxxx@gmail.com 15/06/2015 15/06/2015 00:00.0 00:00.012 xxxxx@gmail.com NULL NULL NULL NULL13 xxxxx@gmail.com 14/06/2015 14/06/2015 00:00.0 00:00.014 xxxxx@gmail.com NULL NULL NULL NULL

Viewing all articles
Browse latest Browse all 3145

Trending Articles