You can employ MySQL user variables to remember results without having to store them in temporary variables in the client.

For example, to find the articles with the highest and lowest price you can do this:

SELECT @min_price:=MIN(price),@max_price:=MAX(price) FROM shop;

SELECT * FROM shop WHERE price=@min_price OR price=@max_price;