0

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?

Someone
  • 709
  • 2
  • 12
  • 29

1 Answers1

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