but on the first line
- ;With Quote as (
- SELECT SID,SHEET,Code, Date, Data,
- LAG(Data) OVER(ORDER BY Date) As LastMonthData
- FROM RMQ_DATA WHERE [SHEET] IN('0','1'))
LAG(Data)
I have an error. So I don't know LAG()
function how to use in SQL Server 2008.
How can I solve this trouble ?