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 89 times
1 Answers
0
Use a UNION
.
SELECT 'users', COUNT(*) as c FROM users UNION SELECT 'names', COUNT(*) as c FROM names;

tdammers
- 20,353
- 1
- 39
- 56