首頁  >  文章  >  後端開發  >  order by btcount desc或 order by btcount失灵,还有什么排序写法吗

order by btcount desc或 order by btcount失灵,还有什么排序写法吗

WBOY
WBOY原創
2016-06-13 12:43:361457瀏覽

order by btcount desc或 order by btcount失效,还有什么排序写法吗?
select * from table where yz='1' order by btcount desc这样写输出不对

btcount这个字段很短,一般都是=0或=1,最大不超过=8

当数据量大时,就不能按btcount值的大于排列了,不知道为什么?

按time又能正确排序的:select * from table where yz='1' order by time desc

就是按btcount不能正确排序,难道是因为btcount字段长度太短了?

但在phpmyadmin中点击升序、降序又有效的,想知道phpmyadmin中难道不是用order by 来升序、降序的吗?


user     btcount         time       id
aaa        0        1359119507       1
bbb        2        1359119506       2
ccc        0        1359119502       4
ddd        1        1359119501       6
eee        0        1359119467       7
fff        3        1359119467       9
ggg        2        1359116785       13
hhh        0        1359119687       15

请高手教我怎么写能正确输出?

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn