MySQL COUNT 2 QUERIES example
SELECT SUM(CM+CN) FROM
(SELECT COUNT(Email) AS CM FROM
(SELECT Email
FROM supplier_company WHERE Email<>'') AS X) AS XX
,
(SELECT COUNT(Email) AS CN FROM
(SELECT Email
FROM supplier_contact WHERE Email<>'' AND Email NOT IN
(SELECT Email
FROM supplier_company WHERE Email<>'')) AS Y) AS YY;
(SELECT COUNT(Email) AS CM FROM
(SELECT Email
FROM supplier_company WHERE Email<>'') AS X) AS XX
,
(SELECT COUNT(Email) AS CN FROM
(SELECT Email
FROM supplier_contact WHERE Email<>'' AND Email NOT IN
(SELECT Email
FROM supplier_company WHERE Email<>'')) AS Y) AS YY;
Comments
Post a Comment