नीचे दिया गया कथन पूरी तरह से काम कर रहा है
SELECT
CASE WHEN DATE1 IS NULL
THEN
(SELECT TOP 1 DATE1 FROM Table1 WHERE ID2<T.ID2
AND Date1 IS NOT NULL ORDER BY ID2 DESC) ELSE Date1 END AS DATENEW,
*FROM Table1 T
नीचे जैसा आउटपुट
DATENEW Date1 ID Class ID2
11/30/2015 11/30/2015 ID1 ClassName 1
11/30/2015 NULL ID1 ClassName 2
11/30/2015 NULL ID1 ClassName 3
11/30/2015 NULL ID1 ClassName 4
12/31/2015 12/31/2015 ID1 ClassName 5
12/31/2015 NULL ID1 ClassName 6
12/31/2015 NULL ID1 ClassName 7