问题描述
朋友们。
我有一张桌子,上面有超过20行。我有一个查询从该表中获取具有相同列的20行。这20行有一列,每行有一个从1到20的值。例如,第一行的列'radif'表示其值为6,第二行的radif列的值为13,其他行如此。我想选择一个最大值为radif列的行。我不知道radif的最大数量,也不知道它的放置位置。我测试了这个我的自己20行并且用'命令由radif asc'命令ssms按此顺序返回数字
1-10-11-12-13-14-15-16-17- 18-19-2-3-4-5-6-7-8-9.i想以这种格式返回ssms返回radif - >
1-2-3-4-5 -6 -...
我该怎么办?请帮帮我。
提前谢谢。
hi friends.
i have a table that i have more than 20 rows on it. i have a query for fetching 20 rows from this table that have a same column. and this 20 rows have a column that for every row it has a value from 1 to 20. for example first row has column 'radif' that its value is 6, second rows radif column has value of 13 and others like this. i want to select a row that has a maximum value of radif column. i do not know maximum number of radif and do not know where it is placed. i tested this my self for 20 rows and with a 'order by radif asc' command ssms return numbers in this order
1-10-11-12-13-14-15-16-17-18-19-2-3-4-5-6-7-8-9.i want to ssms return radif in this format-->
1-2-3-4-5-6-...
how can i do that?please help me.
thanks in advance.
推荐答案
...ORDER BY CAST(radif AS INT) ASC
会暂时做,但要认真 - 改变你的数据库!
Will do it temporarily, but seriously - change your DB!
这篇关于从表中获取行的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!