我正在用php(mysql)生成报告,
例如:
`select count(id) as tot_user from user_table select count(id) as tot_cat from cat_table select count(id) as tot_course from course_table`
这样我有12张桌子。
我可以在单个查询中做到吗。如果我做到了?过程变慢了吗?
SELECT ( SELECT COUNT(*) FROM user_table ) AS tot_user, ( SELECT COUNT(*) FROM cat_table ) AS tot_cat, ( SELECT COUNT(*) FROM course_table ) AS tot_course