3
I already searched in some tutorials but I do not find a specification of how to declare the variable in select by Mysql, follows what I am trying to do.
DECLARE @idPedido INT;
DECLARE @idCombo INT;
SELECT @idPedido = idPedido, @idCombo = idCombo
FROM Pedidos
WHERE idCombo IS NOT NULL;
SELECT @idPedido;
SELECT @idCombo;
You are doing the select and want to change the name of the variable that is returned, this ?
– Erick Zanetti
I want to create the variables and add the value of those fields inside them.
– Sabrina
This is more complicated to do, if I were only to change the name I could use
SELECT idPedido as novaVariavel
...– Erick Zanetti