MySQL Forums
Forum List  »  Newbie

Re: Delete in IF or CASE function
Posted by: Peter Brawley
Date: June 28, 2017 10:10AM

If ...Where x=y... is the base deletion condition, then here's one way ...

delete from input
where x=y and signal_id=0
and exists( select 1 from input where x=y and signal_id=1 );

If what that's doing isn't clear, inspect the result of ...

select x, y, signal_id from input
where x=y and signal_id=0
and exists( select 1 from input where x=y and signal_id=1 );

Options: ReplyQuote


Subject
Written By
Posted
Re: Delete in IF or CASE function
June 28, 2017 10:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.