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

OverTheWire[.com] Natas Walkthrough - JUST HINT, NO SPOILERS

Asp.Net Ending Response options, Response.End() vs CompleteRequest()

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