-- MySQL 5.6
select sname,tname,pname,position,method,expression
from (
select if (table_schema=@sname...partition_name is not null
order by table_schema,table_name,partition_ordinal_position desc) t where rn=0;
-- MySQL...where partition_name is not null) t
where rn=1
order by sname,pname,position,tname;
-- 生成按天分区