sql - Can't save result set into variable in MySQL -
i have problem saving result set data variable in mysql. expect select @var
shows me result set show me last 1 row. here screenshot:
is mistake or incomprehension of variable concepts in mysql?
the value of variable @id
changing every record. having last changed value.
for saving id's product table can use group_concat
this:
select @id := group_concat(id) products; select @id;
Comments
Post a Comment