ORDER BY:データの並び替え

データを昇順で並べる

SELECT * FROM my_items;

ORDER BY
SELECT * FROM my_items ORDER BY id ASC;

※「ASC」:Ascending order

SELECT * FROM my_items ORDER BY id DESC;

※「DESC」:Descending order

WHEREと組み合わせる
SELECT * FROM my_items WHERE price<=180 ORDER BY price;

※価格が「180」円以下の商品を安い順に取り出し並べる。