MySQL问题求助,救救孩子!!!

问题:查询下表中,不同月份price由高到底前三名的数据?

大佬,救救孩子吧。

+----+------+------------+-------+
| id | name | year       | price |
+----+------+------------+-------+
|  1 | a    | 2021-01-01 |    20 |
|  4 | aa   | 2021-02-01 |    10 |
|  2 | b    | 2021-01-02 |    10 |
|  5 | bb   | 2021-02-02 |    60 |
|  3 | c    | 2021-01-03 |    10 |
|  6 | cc   | 2021-02-03 |     5 |
|  4 | d    | 2021-01-04 |    50 |
|  7 | dd   | 2021-02-04 |    70 |
+----+------+------------+-------+

select * from xxxxxxxxxxxxxxxxxxxxxx_your_table a
where (select count(1) from xxxxxxxxxxxxxxxxxxxxxx_your_table b where a.year=b.year and  a.price<b.price ) < 3
order by 
    year, price;

具体查看: https://lawsssscat.blog.csdn.net/article/details/102942298