[SQL ] 詢問關於Mssql語法轉Mysql語法

看板Database作者 (victory)時間14年前 (2009/12/14 15:01), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/2 (看更多)
這是一個供分頁使用的Ms-SQL Command ipage = 1 //ipage 是分頁的頁碼 cpage = 5 //cpage 是每頁顯示筆數 select Top "+ipage+" au_id,au_lname,au_fname,address,phone from authors where au_id not in ( select top "+(cpage-1)*ipage+" au_id from authors order by au_id desc ) order by au_id desc ---------下面為自己改寫的Mysql command--------------- select * from authors where au_id not in ( select au_num from authors order by au_num limit "+(cpage-1)*ipage+" ) order by au_num desc limit ipage 出現的錯誤碼為: 1235-The version of MySQL doesn't support 'LIMIT _IN/ALL/ANY/SOME subQuery' 請教我如何依此邏輯,可以改寫成一個可以控制分頁的MysSQL command <('_')> 感謝 -- "真實" 和 "謊言" 一起到河邊洗澡 先上岸的 "謊言" 偷偷穿上 "真實" 的衣服不肯歸還 固執的 "真實" 死也不肯穿上 "謊言" 的衣服 只好一絲不掛光溜溜地走回家 從此 人們眼中只有穿著真實外衣的謊言 卻怎麼也無法接受赤裸裸的真實 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.111.166.142 ※ 編輯: victer0327 來自: 140.111.166.142 (12/14 15:01)

12/14 15:26, , 1F
用 join 的?
12/14 15:26, 1F

12/14 16:33, , 2F
可以更清楚些嗎??原波資質駑鈍@@"
12/14 16:33, 2F
參考網址:http://www.javanb.com/jsp/1/4087.html ※ 編輯: victer0327 來自: 140.111.166.142 (12/14 17:34)
文章代碼(AID): #1B9UB7ol (Database)
文章代碼(AID): #1B9UB7ol (Database)