RE: [PHP-DB] Finding NoMatches in MySQL From: Dave Watkinson (d.watkinson <email protected>)
Date: 07/30/01

Thanks everyone that was just the ticket :)

Off to read up on JOINs now...

Thanks again

Dave

-----Original Message-----
From: Dobromir Velev [mailto:diadomraz <email protected>]
Sent: 30 July 2001 08:42
To: Dave Watkinson; PHP-MySQL List
Subject: Re: [PHP-DB] Finding NoMatches in MySQL

Hi,
I think this query should do the job

SELECT jobs.uid FROM jobs LEFT JOIN employers ON jobs.id1 = employers.uid
WHERE employers.uid is Null

Dobromir Velev

-----Original Message-----
From: Dave Watkinson <d.watkinson <email protected>>
To: PHP-MySQL List <php-db <email protected>>
Date: Monday, July 30, 2001 12:56 AM
Subject: [PHP-DB] Finding NoMatches in MySQL

>Hi all
>
>During the process of importing a lot of Oracle data into MySQL, I have two
>tables that are giving me a bit of a headache. One is a list of jobs and
the
>other is a list of employers. There's now a unique id for each table, and
>the job table also has a column called id1, which *should* correspond to
>employers.uid.
>
>With me so far?
>
>Well, the problem is that there were loads of duplications in the employers
>table, and after deleting the duplicates some of the jobs.id1 records now
>point to non-existing records.
>
>How do I do a query that does something like this...
>
>select jobs.uid from jobs where jobs.id1 not in employers.uid
>
>???
>
>many thanks in advance!
>
>Dave
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-db-unsubscribe <email protected>
>For additional commands, e-mail: php-db-help <email protected>
>To contact the list administrators, e-mail: php-list-admin <email protected>
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>