At 10:42 PM 2/25/2007, mos wrote:
At 06:13 PM 2/25/2007, Miles Thompson wrote:
Would someone please check this delete query?
This should delete all rows from the geodesic_user_data that have no
match in the subscriber table, but another set of eyes would be appreciated.
DELETE geodesic_user_data
FROM geodesic_user_data
LEFT JOIN subscriber ON
geodesic_classifieds_userdata.id=subscriber.GeoClassID
WHERE subscriber.GeoClassID IS NULL;
Our hosting company uses MySQL 4.0.17 so the subquery approach is not
possible.
Thanks in advance - Miles
Miles,
It looks fine but you could have checked it yourself using:
select *
FROM geodesic_user_data
LEFT JOIN subscriber ON geodesic_classifieds_userdata.id=subscriber.GeoClassID
WHERE subscriber.GeoClassID IS NULL;
--
Thanks Mos, and to everyone else who responded.
I had tested it with a SELECT; it was just that other set of eyes that I
needed for confirmation.
I did what I should have donein the first place - exported the appropriate
tables with data, created them on my computer, and tested the deletes. They
worked fine.
Tomorrow evening they will get run for real.
Regards - Miles
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.412 / Virus Database: 268.18.4/702 - Release Date: 2/25/2007
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]