Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DROP PROCEDURE LoopDemo;
- create procedure LoopDemo()
- BEGIN
- DECLARE x INT;
- DECLARE str VARCHAR(255);
- DECLARE tmp_pubb_dal VARCHAR(255);
- SET x = 2490;
- SET str = '';
- loop_label: LOOP
- IF x > 2501 THEN
- LEAVE loop_label;
- END IF;
- SET x = x + 1;
- SELECT pubb_dal into tmp_pubb_dal from N_DETERMINE where numero = `x` and data like '%2019' limit 1;
- SET str = CONCAT(str,tmp_pubb_dal,',');
- END LOOP;
- SELECT str;
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement