Monday, June 30, 2014

Need help in UPDATE data in SQL Query


Hi Kalman,


yes I do have a timestamp column...But how can I do that?




Maruthi...




UPDATE T SET WeekName = ISNULL(WeekName , (SELECT TOP 1 WeekName FROM YrTable WHERE timestamp < T.TimeStamp AND WeekName IS NOT NULL ORDER BY TimeStamp DESC))

FROM YrTable T







Thanks and regards, Rishabh K


No comments:

Post a Comment