gpt4 book ai didi

mysql 结果需要我的例子

转载 作者:行者123 更新时间:2023-11-28 23:42:56 25 4
gpt4 key购买 nike

我有一张餐 table 。我需要先显示“开放餐厅”,然后显示关闭餐厅的结果,而且我搜索的邮政编码是 2600。所以首先列出邮政编码 2600,然后是开放餐厅,然后是开放餐厅的其他邮政编码。然后是关闭餐厅的 2600,然后是关闭餐厅的其他邮政编码。

restid  resname Zipcode status
1 Res1 2600 Open
2 Res2 2500 Closed
3 Res3 3600 Closed
4 Res4 2600 Open
5 Res5 2500 Closed
6 Res6 2600 Open
7 Res7 3600 Open
8 Res8 3600 Open
9 Res9 2500 Closed
10 Res10 2600 Closed

我需要这样的结果......

restid  resname zipcode status
1 Res1 2600 Open
2 Res4 2600 Open
3 Res6 2600 Open
4 Res7 3600 Open
5 Res8 3600 Open
6 Res2 2500 Closed
7 Res3 3600 Closed
8 Res5 2500 Closed
9 Res9 2500 Closed
10 Res10 2600 Closed

提前致谢。

最佳答案

select restid,resname,zipcode,status from sometable order by statys desc

关于mysql 结果需要我的例子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34047931/

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