第一頁:
select id,name,price,origin from tab where id>0 and origin in ('新浪','百度','谷歌','問問') order by id limit 10;
記下這一頁最后一行的id值,假設為num,
第二頁:
select id,name,price,origin from tab where id>num and origin in ('新浪','百度','谷歌','問問') order by id limit 10;
以此類推。
uj5u.com熱心網友回復:
不行,得出的都是同一個,比如都是origin=新浪的資料
uj5u.com熱心網友回復:
你的意思是回傳的資料一定要包含“新浪,百度,谷歌,問問”這四個?
uj5u.com熱心網友回復:
第一頁:
select id,name,price,origin from tab where id>0 and origin in ('新浪','百度','谷歌','問問') order by id limit 10;
記下這一頁最后一行的id值,假設為num,
第二頁:
select id,name,price,origin from tab where id>num and origin in ('新浪','百度','谷歌','問問') order by id limit 10;
以此類推。
有個笨拙的方法,
select * from (select * from test where origin='百度' order by id limit 0,2) a
union all
select * from (select * from test where origin='谷歌' order by id limit 0,2) b
union all
select * from (select * from test where origin='新浪' order by id limit 0,2) c
union all
select * from (select * from test where origin='問問' order by id limit 0,2) d
union all
select * from (select * from test where originnot in ('百度','谷歌','新浪','問問') order by id limit 0,2) e;
uj5u.com熱心網友回復:
有個笨拙的方法,
select * from (select * from test where origin='百度' order by id limit 0,2) a
union all
select * from (select * from test where origin='谷歌' order by id limit 0,2) b
union all
select * from (select * from test where origin='新浪' order by id limit 0,2) c
union all
select * from (select * from test where origin='問問' order by id limit 0,2) d
union all
select * from (select * from test where originnot in ('百度','谷歌','新浪','問問') order by id limit 0,2) e;
可以,謝謝
uj5u.com熱心網友回復:
有個笨拙的方法,
select * from (select * from test where origin='百度' order by id limit 0,2) a
union all
select * from (select * from test where origin='谷歌' order by id limit 0,2) b
union all
select * from (select * from test where origin='新浪' order by id limit 0,2) c
union all
select * from (select * from test where origin='問問' order by id limit 0,2) d
union all
select * from (select * from test where originnot in ('百度','谷歌','新浪','問問') order by id limit 0,2) e;
**桔妹導讀:**深耕人工智能領域,致力于探索AI讓出行更美好的滴滴AI Labs再次斬獲國際大獎,這次獲獎的專案是什么呢?一起來看看詳細報道吧! 近日,由國際計算語言學協會ACL(The Association for Computational Linguistics)舉辦的世界最具影響力的機器 ......
我們經常在資料庫中使用 LIKE 運算子來完成對資料的模糊搜索,LIKE 運算子用于在 WHERE 子句中搜索列中的指定模式。 如果需要查找客戶表中所有姓氏是“張”的資料,可以使用下面的 SQL 陳述句: SELECT * FROM Customer WHERE Name LIKE '張%' 如果需要 ......
關于MySQL的二進制日志(binlog),我們都知道二進制日志(binlog)非常重要,尤其當你需要point to point災難恢復的時侯,所以我們要對其進行備份。關于二進制日志(binlog)的備份,可以基于flush logs方式先切換binlog,然后拷貝&壓縮到到遠程服務器或本地服務器 ......