I have a table which contains the following data:
| ID | Amount | Date |
|---|---|---|
| 1 | 500 | 2021-05-01 |
| 2 | 100 | 2021-05-03 |
| 3 | 300 | 2021-05-06 |
I need to get the first record which exceeds a specific amount, such as the following examples:
- If specific amount is 500, we return ID 1
- If specific amount is 550, we return ID 2
- If specific amount if 600, we return ID 2
- If specific amount > 600, we return ID 3
How can this be achieved using a MySQL query?