Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DELIMITER $$
- DROP PROCEDURE IF EXISTS delete_apple_tracks;
- CREATE PROCEDURE delete_apple_tracks (fileid int)
- BEGIN
- DECLARE cnt int default 0;
- REPEAT
- delete from apple where id in (select * from (select id from apple where file_id = fileid limit 10000) as id);
- set cnt = (select count(*) from apple where file_id = fileid);
- UNTIL cnt > 1
- END REPEAT;
- END$$
- DELIMITER ;
Advertisement
Add Comment
Please, Sign In to add comment