0

I have an Stored Procedure which does make an UPDATE for more than one rows. But it doesn't work. Below is the code:

DELIMITER $$

CREATE PROCEDURE `dbnine`.`vacores` ()
BEGIN

SET @a = (
SELECT acores from infos_bureau
where agent = '');

SET @b = (
SELECT DISTINCT agent from infos_bureau
where acores = @a
AND agent !='');

UPDATE infos_bureau set agent = @b
WHERE agent = '';

END

I want to know is it possible to make a loop inside?

Thanks in advance

Grijesh Chauhan
  • 55,177
  • 19
  • 133
  • 197
achillix
  • 403
  • 3
  • 17

1 Answers1

0

study example from below link..

Looping Over Result Sets in MySQL

Community
  • 1
  • 1
Vijay
  • 7,651
  • 9
  • 41
  • 69