如何在sql server中跳过AutoId? [英] How to Skip AutoId in sql server?

查看:133
本文介绍了如何在sql server中跳过AutoId?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Everybody,

如何在sql server中跳过自动递增的id

例如,

Id Name

=====================

1 John

2 Mark

3凯文

4彼得

6乔



如果输入数字是2那么我想跳过那些相关的ID和结果应该是这样的



Id Name

=============== =======

1 John

3 Kevin

6 Joe



谢谢你

Hello Everybody,
How to Skip auto incremented id in sql server
For Example,
Id Name
=====================
1 John
2 Mark
3 Kevin
4 Peter
6 Joe

If the input is number 2 then i want to skip those related ids and result should be like this

Id Name
======================
1 John
3 Kevin
6 Joe

THANK YOU

推荐答案

我解决了我使用while循环


这篇关于如何在sql server中跳过AutoId?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆