SQL计算上下两行某列的差
程序员文章站
2022-06-17 20:35:24
SELECT * FROM #TempHuDong SELECT * FROM #TempHuDong SELECT TOP 1 ABS(a.num -b.num) '差' FROM (select row_number()over(order by getdate()) as id,* from ......
SELECT * FROM #TempHuDong
SELECT * FROM #TempHuDong
SELECT TOP 1 ABS(a.num -b.num) '差'
FROM (select row_number()over(order by getdate()) as id,* from #TempHuDong) as a
LEFT JOIN (select row_number()over(order by getdate()) as id,* from #TempHuDong) as b
ON a.id = b.id - 1
上一篇: 联发科mt8195处理器怎么样 联发科mt8195性能全面评测
下一篇: touch创建文件