我正在用 php (mysql) 生成报告,
I am generating a report in 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 张桌子.
Like this I have 12 tables.
我可以在单个查询中创建它吗?如果我做了?进程变慢?
Can i make it in single query. If i did? Process gets slow?
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
这篇关于单个查询中的多个选择语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!