MySQL: Returning multiple rows of values

This entry is part 17 of 26 in the series Learn MySQL

User variables hold single values.

If you assign a value to a variable using a statement that returns multiple rows, the value from the last row is used.

select @p := price from artist;
select @p;



Series Navigation<< MySQL: Select and display a variable
MySQL: Assign expression to a variable >>

Leave a comment

Leave a Reply