[SQL ] mysql,加上order 數據錯誤。

看板Database作者 (ptt20000)時間14年前 (2011/06/19 01:02), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串1/1
各位大大您好! 小弟我使用的是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

06/20 17:55, , 1F
我好奇的是count前為什麼要order...
06/20 17:55, 1F

06/20 22:35, , 2F
count只是舉例...:)
06/20 22:35, 2F
文章代碼(AID): #1D_DeyI0 (Database)