Select countyid, districtid, sales From country c, district d, sales s Where c. countryid =d.districtid And d.districtid = s. Salesid Where salesid not in () Group by countryid
NOT EXISTS
SELECT d.districtid, c.countryid FROM district As d INNER JOIN country As C ON c.countryid = d.countryid WHERE Not Exists ( SELECT 1 FROM sales As s WHERE s.districtid = d.districtid ) ;
WHERE salesid NOT IN ()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)