作者ptt2000 (ptt20000)
看板Database
標題[SQL ] mysql,加上order 數據錯誤。
時間Sun Jun 19 01:02:49 2011
各位大大您好!
小弟我使用的是mysql
發生一個奇怪的問題
使用select count(*) from table_name where A_row_name='x';
假設搜尋出來是10筆
但是我改寫成
select count(*) from table_name where A_row_name='x' order by B_row_name asc;
結果卻是0,另外如果我把A_row_name改成C_row_name
select count(*) from table_name where C_row_name='x' order by B_row_name asc;
結果卻正常
請問這是甚麼問題呢??
爬問及GOOGLE大師有查到配合limit
不過我使用後還是正常
是BUG嗎?還是有錯誤呢?
請各位大大指教
感謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 115.83.183.132
1F:→ trewkkk:我好奇的是count前為什麼要order... 06/20 17:55
2F:→ ptt2000:count只是舉例...:) 06/20 22:35