gpt4 book ai didi

mysql - 如何按 ASC 顺序获取 MySql 不同(不同)值

转载 作者:行者123 更新时间:2023-11-29 12:09:57 30 4
gpt4 key购买 nike

我有 table

像这样

--------------------------------------------
id size title priority
---------------------------------------------
1 4 sample title1 2
2 2 sample title2 2
3 3 sample title3 1
4 1 sample title4 2
5 2 sample title5 1
6 3 sample title6 2
7 1 sample title7 1
8 4 sample title8 1
-------------------------------------------

我想要一个查询来获取如下输出:

--------------------------------------------
id size title priority
---------------------------------------------
7 1 sample title7 1
5 2 sample title5 1
3 3 sample title3 1
8 4 sample title8 1
4 1 sample title4 2
2 2 sample title2 2
6 3 sample title6 2
1 4 sample title1 2


-------------------------------------------

所以,我希望按升序排列的不同大小值也按升序检查优先级。

最佳答案

正如Giorgos Betsos提到的:

SELECT * FROM table_ ORDER BY priority, size  ASC;

DEMO

关于mysql - 如何按 ASC 顺序获取 MySql 不同(不同)值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30864295/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com