Sql语句求最小可用id
摘要:selectidfromtestawherenotexists(select1fromtestwhereid=a.id+1)orderbyi...
selectidfromtestawherenotexists
(
select1fromtestwhereid=a.id+1
)
orderbyid
缺点,不从1开始计算。
【Sql语句求最小可用id】相关文章:
★ Select data from an Excel sheet in MSSQL
★ sql 左连接和右连接的使用技巧(left join and right join)
★ 用户管理的备份(一致性备份、非一致性备份、脱机备份、联机备份)
★ SQL Server不存在或访问被拒绝问题的解决第1/3页