Francisco Reyes wrote:
> When I try to run:
> delete from export_messages where export_id in
> (SELECT distinct export_messages.export_id as id
> FROM export_messages
> LEFT OUTER JOIN exports ON (export_messages.export_id = exports.export_id)
> );
Why not use EXISTS?
DELETE FROM export_messages WHERE NOT EXISTS (
SELECT 1
FROM exports
WHERE exports.export_id = export_messages.export_id
)
I suppose you run those queries in a transaction block, right?
--
Alban Hertroys
alban(at)magproductions(dot)nl
magproductions b.v.
T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
7500 AK Enschede
// Integrate Your World //