本文介绍了数字未按升序插入表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

int s =从roomdetails中选择isull(max([rid]),0)+1

(注意:如果我去10,11,最多可正确插入roomno 9,然后将其存储在roomno 1的下一行中)

创建表roomdetails(roomno nvarchar(250))

插入roomdetails(@roomno)值;
[我不应该将roomno更改为int]


Roomno
1
10-[错误地存储在这里]
2
3
4
5
6
7
8
9
-[应该来到这里]

int s=select isnull(max([rid]),0)+1 from roomdetails

(Note: Upto roomno 9 inserting correctly if i go 10,11 then its getting store in below row of roomno 1)

Create table roomdetails (roomno nvarchar(250))

insert into roomdetails(@roomno) values(s);
[ i am not suppose to change roomno into int]


Roomno
1
10 -- [wrongly stored here]
2
3
4
5
6
7
8
9
--[should come here]

推荐答案


Select [rid] From roomdetails Order By [rid]


这篇关于数字未按升序插入表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 21:04