mysql中子查询limit用法备忘

select owner,count(*) as count from table1 where owner in (select xx.owner from (select owner from table1 where DATE_SUB(CURDATE(), INTERVAL 1 DAY) <= date(date) and range>="75" group by owner order by count(*) desc limit 20) as xx) group by owner order by count desc;

你可能感兴趣的:(sql,limit)