Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
选择表中的行,比较 yesderday 和 today 之间的一列,如果今天的值不等于 yesderaday 的值,因此表中的其他列应更新为“已更改”或“未更改”...有什么建议吗??
在同一张表之间使用自联接。
SELECT *, CASE WHEN a.value = b.value THEN 'Not' ELSE 'Changed' END AS Modified FROM MyTable a INNER JOIN MyTable b ON Dateadd(d, -1, a.mydate) = b.mydate