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: enter image description here

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

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -