日期:2014-05-18  浏览次数:20715 次

SQL2000 一个最近简单的 排序,为什么不能成功?
我在SQL2000中,使用如下语句:
select tel_yChongzhi.*,tel_userMoney.memo from tel_yChongzhi,tel_userMoney where tel_yChongzhi.khquhao='371'and tel_yChongzhi.khuser=tel_userMoney.usercode order by tel_ychongzhi.khuser asc , tel_userMoney.memo asc

为什么不能成功?只有第一个(khuser)排序了,第二个没有排序啊 ,怎么解决这个问题???

------解决方案--------------------
楼主看一下结果集,定义排序:首先根据第一个排序规则,第一个相同时才会根据第二个进行排序
------解决方案--------------------
呵呵,还是仔细看一下结果集,一般情况下不会出现这样的问题!
------解决方案--------------------
select tel_yChongzhi.*,tel_userMoney.memo from tel_yChongzhi,tel_userMoney
???????????????????????????????????????????????????????????????????????????
本人初学SQL
请教各位大侠
上面的语句用的对吗?
------解决方案--------------------
select tel_yChongzhi.*,tel_userMoney.memo from tel_yChongzhi,tel_userMoney where tel_yChongzhi.khquhao= '371 'and tel_yChongzhi.khuser=tel_userMoney.usercode order by tel_ychongzhi.khuser asc , tel_userMoney.memo asc 

为什么不能成功?只有第一个(khuser)排序了,第二个没有排序啊 ,怎么解决这个问题???

第一个排了后,在第一个的基础上再排第二个的.不是先对第二个进行排序.