sql数据库中表的id添加的问题
表 test
id ip date
127.0.0.1 xxxxxxxx
127.0.0.2 xxxxxxxx
168.224.5.6 xxxxxxxx
1.本人新手,想请教各位前辈,如上小图,我将sql表test1的ip date导入另外一个数据表test的ip date中,但是还有一张sql表test2也需要导入test.
问题出现了,test1里包含id ,test2没有id,导入test id混乱,我已将test id列内容删除,请问有什么方法可以直接写入id,让id从1-10000按照行自动排列么。
2.我试过那个 int identity(1,1) 标识,感觉不行,在一个表导入此表的时候,提示我标识不能为空。如果为空虽然可以导,但是导入标识也就没有了。
3.此表附带的一个问题,我想按照date 最新的日期desc排序
select * from kai(表名) order by datenew desc,就是这功能,但是我需要的是update.更新在表上。
求具体代码啊,谢谢各位