I have different MySQL tables such as users, news and etc. I want to know users number, news number with one MySQL query. How can I do that?
Asked
Active
Viewed 88 times
1 Answers
0
Use a UNION.
SELECT 'users', COUNT(*) as c FROM users UNION SELECT 'names', COUNT(*) as c FROM names;
tdammers
- 19,940
- 1
- 35
- 54