十张表加起来的数据量 大概是多少? 若数据量 不是很大的话,可以按照 古舟蓑笠翁 的做法来
你SQL 中的from_unixtime 函数,这样 跑法,速率应该不是 很高吧!?
建议 分步骤去做,先把时间戳 换成 datetime 后,再一步一步汇总统计,统计规则,你是很清楚的
select datanum,pay_type,datatime
from (select * from aut_user_recharge_record_1
union all select * from aut_user_recharge_record_2
union all select * from aut_user_recharge_record_3
union all select * from aut_user_recharge_record_4
union all select * from aut_user_recharge_record_5
union all select * from aut_user_recharge_record_6
union all select * from aut_user_recharge_record_7
union all select * from aut_user_recharge_record_8
union all select * from aut_user_recharge_record_9
union all select * from aut_user_recharge_record_10)