qqqgg通过本文主要向大家介绍了等相关知识,希望本文的分享对您有所帮助
查找新插入的一条数据在表中的位置,这一句话即可以实现
(select ident_current('tb_driverReportInput') as id)
,现在是要在某个集合中查找新插入的数据位置,就是第几个
需要三行代码:
select * from
(select id,ROW_NUMBER() over (order by fromDateTime) as num from [tb_driverReportInput] where train='0265' ) as b
where id=(select ident_current('tb_driverReportInput') as id)
中间一行是某个查询条件。
语句很简单,注意表别名。