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;

Comments

Popular posts from this blog

c# Service Play Sound with NAudio example by Moshe

SOLVED The item could not be indexed successfully because the item failed in the indexing subsystem

JS/JQ simulate Enter event