select ... from 表名 where ... group by ... having ... order by ... limit ...;
select ... from A left/right join B on ... where ...;
select ... from 表名 where ... group by ... having ... order by ... limit ...;
select ... from A left/right join B on ... where ...;