字段是数字的排序问题

hnsongbiao 2010-06-02 06:11:08
表ylcnv

id num 00001 00002 00003
1 2223 32 22 11
2 323 44 12 44
3 23 3 3 2



select * from ylcnv order by [00003] desc

请问 有一字段是数字 这样排序怎么结果不正确呢?
...全文
39 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Justin-Liu 2010-06-02
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 fredrickhu 的回复:]
SQL code
select * from ylcnv order by cast([00003] as int)desc
[/Quote]
我准备闲暇的时候在SQL区混混 补补基础
Justin-Liu 2010-06-02
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 fredrickhu 的回复:]
SQL code
select * from ylcnv order by cast([00003] as int)desc
[/Quote]
--小F-- 2010-06-02
  • 打赏
  • 举报
回复
select * from ylcnv order by cast([00003] as int)desc
--小F-- 2010-06-02
  • 打赏
  • 举报
回复
要得到什么结果?
Justin-Liu 2010-06-02
  • 打赏
  • 举报
回复
排序结果是根据字符串排的好像

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧