选择和分组下表时出现问题。 表" Igralci"看起来像这样:
{
"errorMessage": "RequestId: 6737e0a4-68af-11e7-8ab8-7fb105ccffaacc Process exited before completing request"
}
我想按以下方式对id进行排序:
----------------------------------------------
|ID|U_ID|st_tock|st_srecanj|st_nizov|st_gemov|
----------------------------------------------
|19| 17 | 6 | 3 | 6 | 72 |
----------------------------------------------
|11| 19 | 12 | 6 | 24 | 144 |
----------------------------------------------
|15| 18 | 12 | 6 | 26 | 72 |
----------------------------------------------
我试过了:
1. First looks at st_tock (if st_tock is same) ->
2. Looks at st_srecanj (if st_srecanj is same) ->
3. Looks at st_nizov (if st_nizov is same) ->
4. Looks at st_gemov
想要的显示是(ID' s):
答案 0 :(得分:1)
你需要添加" Desc"或" asc"到你的order by子句来获得你想要的结果。根据您提供的输出,您需要添加" Desc"在
之后的每一列之后Select * from Igralci
group by id, st_tock, st_srecanj, st_nizov, st_gemov
order by st_tock desc, st_srecanj desc, st_nizov desc, st_gemov desc;