看板
[ Database ]
討論串[SQL ] 選取特定主鍵跟其下一筆之外的資料
共 7 篇文章
內容預覽:
select news.* from news,. (select id from news where id=10 order by id limit 1 ) as a ,. (select id from news where id>10 order by id limit 1 ) as b.
(還有201個字)
內容預覽:
假說要從現有資料中找出某一筆和其上(下)一筆以外的資料. 照理來說用以下的query就可以. select * from tab where id not in. (select id from tab where id>=10 limit 2). 不過MySQL 不支援在in/on..等子查詢中使
(還有266個字)