sqlsever 查询最后一条数据
程序员文章站
2023-08-26 10:39:37
select * from(select row_number() over(partition by IDCARD order by DATATM desc) as rownum,* from (SELECT * FROM TABLENAME)as H1 ) as H where H.rownum ......
select * from(select row_number()
over(partition by IDCARD order by DATATM desc) as rownum,*
from (SELECT
*
FROM
TABLENAME
)as H1
) as H where H.rownum =
1
解释:红色为以什么分组 蓝色为以什么排序 紫色为表名 目前是获取表中每个 IDCARD中时间最大的一条
上一篇: 数据库端的分页处理
下一篇: 云大数据:大数据的社会生态化