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
  • 57,103
  • 20
  • 141
  • 208
achillix
  • 457
  • 4
  • 17

1 Answers1

0

study example from below link..

Looping Over Result Sets in MySQL

Community
  • 1
  • 1
Vijay
  • 8,131
  • 11
  • 43
  • 69