阅读背景:

LAG工作,LEAD在同一语句中返回1

来源:互联网 

I am puzzled over LEAD returning always ID=1, which is not even an ID in the table (ID start at ~18k), instead of a valid ID for the next record. NULL values are where they supposed to be, it's just the rows, which supposed to contain a valid ID. The LAG with the same syntax works as expected, returning correct values. The LEAD doesn't even work (correctly), when I comment out LAG. By the way, I copied the code (and just changed table and column names) from my other script, where it was working fine., w




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: