Using user variables
--------------------
You can use MySQL user variables to remember results without having to
store them in temporary variables in the client. Note:Variables.
For example, to find the articles with the highest and lowest price you
can do:
select @min_price:=min(price),@max_price:=max(price) from shop;
select * from shop where price=@min_price or price=@max_price;
+---------+--------+-------+
| article | dealer | price |
+---------+--------+-------+
| 0003 | D | 1.25 |
| 0004 | D | 19.95 |
+---------+--------+-------+