Instantly share code, notes, and snippets.

View intercambio.sql
delimiter //
create procedure hacer_intercambio(in groupid int, out a varchar(200), out b varchar(200))
begin
drop table if exists temp1;
drop table if exists temp2;
-- Crea una tabla temporal para guardar los ids de los participantes
create temporary table temp1 as (select users.id from
users, participants, participates
where participates.participant_id = participants.id and
participants.user_id = users.id and