sql >> Base de Datos >  >> RDS >> Mysql

COUNT (*) de varias tablas en MySQL

Puede hacerlo usando subconsultas, una subconsulta para cada tableCount:

SELECT
  (SELECT COUNT(*) FROM table1 WHERE someCondition) as table1Count, 
  (SELECT COUNT(*) FROM table2 WHERE someCondition) as table2Count,
  (SELECT COUNT(*) FROM table3 WHERE someCondition) as table3Count