Reputation: 1483
I have three mysql table named users
,'clients
' and 'products
'. I want to count the 'id' field of every table in same query. Is it possible? please help me.
Thanks in advance.
Upvotes: 1
Views: 63
Reputation: 26
Please this statement
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
Upvotes: 1