在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/數(shù)據(jù)庫(kù)/ 篩選數(shù)據(jù)sql

篩選數(shù)據(jù)sql

圖片描述

望大神給個(gè)詳細(xì)點(diǎn)的過(guò)程

回答
編輯回答
夏夕

為啥要在sql里面做這么多的邏輯處理,查出結(jié)果再對(duì)數(shù)據(jù)處理的方式比較好吧,也不必依靠id和日期的對(duì)應(yīng)關(guān)系

2017年11月11日 13:13
編輯回答
夢(mèng)囈

請(qǐng)參考這個(gè)問(wèn)題。

2017年11月28日 21:58
編輯回答
六扇門(mén)
select * 
from 
    tourists
where 
    find_in_set(id,
    (select group_concat(id_3) gid 
     from 
        (select group_concat(id) id_all from tourists where visits>=100) a,
        (select concat(id,",",id+1,",",id+2) id_3 from tourists where visits>=100) b
     where locate(id_3,id_all)>0
    ));
2017年11月11日 09:07