我有三个名为users
的mysql表,' clients
'和' products
'。我想算上这个' id'同一查询中每个表的字段。可能吗?请帮我。
提前谢谢。
答案 0 :(得分:1)
请发表声明
SELECT u.total_users, c.total_clients, p.total_products (
SELECT COUNT(id) as total_users FROM users
) as u,
(
SELECT COUNT(id) as total_clients FROM clients
) as c,
(
SELECT COUNT(id) as total_products FROM products
) as p