Home  >  Article  >  Backend Development  >  order by btcount desc或 order by btcount失灵,还有什么排序写法吗

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

WBOY
WBOYOriginal
2016-06-13 12:43:361457browse

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

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn