# Using `ORDER BY` and `LIMIT` in `UPDATE`

__*LIMIT clause*__

+ Quiz: This time, can you tell which planet is going to be updated in advance?

```
tidb> SELECT name, gravity, ring_systems FROM planets WHERE gravity < 6;
+---------+---------+--------------+
| name    | gravity | ring_systems |
+---------+---------+--------------+
| Mercury |     3.7 |            0 |
| Mars    |     3.7 |            0 |
| Pluto   |     0.7 |            0 |
+---------+---------+--------------+
3 rows in set (0.00 sec)

tidb> UPDATE planets SET ring_systems = 1 WHERE gravity < 6 ~!@ORDER BY gravity, name LIMIT 1@!~;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

tidb> SELECT name, gravity, ring_systems FROM planets WHERE gravity < 6;
+---------+---------+--------------+
| name    | gravity | ring_systems |
+---------+---------+--------------+
| Mercury |     3.7 |            0 |
| Mars    |     3.7 |            0 |
| Pluto   |     0.7 |            ~!@1@!~ |
+---------+---------+--------------+
3 rows in set (0.01 sec)
```
------------------------------------------------------------

Like SELECT, you have to use ORDER BY to ensure the "ORDER".
