gpt4 book ai didi

sql - 按低、中、高排序?

转载 作者:行者123 更新时间:2023-12-01 07:26:45 24 4
gpt4 key购买 nike

所以,我有这个:

select ticket_trackingno, ticket_title, ticket_priority_id, ticket_status_id
from hd_tickets
where ticket_priority_id <> 'None'
and ticket_status_id = 'Assigned'
order by ticket_priority_id desc

有了这个,我的 ticket_priority_id 列被排序为中、低、高。我想要的是低,中,高。我想知道我该怎么做?

最佳答案

ORDER BY CASE ticket_priority_id
WHEN 'low' THEN 1
WHEN 'med' THEN 2
WHEN 'high' THEN 3 END

关于sql - 按低、中、高排序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19185792/

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