第二题暴力解

select uid
from user_info
where gender='女' and age<='25'
and uid in
(select uid from user_video
where date>='20190801' and date<='20190807' and tag=='美食'
group by uid
having count(uid)>10)
and uid in
(select uid from user_video
where date=='20190808' and tag=='美食'
group by uid
having count(uid)<3)

第三题

select distinct tag, max(cnt) over (partition by tag)-min(cnt) over (partition by tag)
from
(select tag, uid, count(uid) cnt
from user_video
group by tag, uid)

第一题求大佬

突然发现个问题,他所有的字段都是varchar的……包括年龄这种数字