How to exclude the result of union of two tables from the result of union of other two tables

From: Date: Fri, 05 Sep 2003 08:03:22 +0000
Subject: How to exclude the result of union of two tables from the result of union of other two tables
Groups: php.db 
Request: Send a blank email to php-db+get-30364@lists.php.net to get a copy of this message
I have a php page where I would like to list a numer of companies as below: 1- retrieve all distinct company names from TableA (SELECT company_name FROM TableA) 2- retrieve all distinct company names from TableB 3- combine the two lists as list1 4- retrieve all distinct company names from TableC 5- retrieve all distinct company names from TableD 6- combine the two lists as list2 7- display company names in list1 that don't exist in list2 MySql version is 3.23.56 3.23.56 , so I cannot use UNION. I would like to accomplish this with as little php code as possible, using mostly SQL. Thanks, Oz.

« previous php.db (#30364) next »