> I have a table of users and also a table of cost centres they have access
> to in a one to many relationship. I have done a purge of old users and
> now wish to clean up the cost centre access table. I can do the following
> query to find out which rows in the cost centre access table I wish to
> delete:-

> All the cases where b.user is null I wish to delete from the cc table. Is
> there a way of doing this:-
> delete from cc select a.user from cc a left outer join users b
> on a.user=b.userwhere b.user is null;
>
You'd have to do multiple SQL statements. MySQL doesn't do deletes on a join
unfortunately. Oh and you can't do subqueries either. You're gonna have to
go the hard way I'm afraid.

Cheers,
 Graeme

--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to