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
提前致谢。
答案 0 :(得分:1)
select restid,resname,zipcode,status from sometable order by statys desc
答案 1 :(得分:0)
您可以尝试以下解决方案: -
SELECT restid,resname,zipcode,status FROM restaurant WHERE zipcode = 2600 ORDER BY status DESC;
它可能对你有帮助。
答案 2 :(得分:0)
尝试此查询以获得所需的输出。
select * from restaurant WHERE zipcode = 2600 order by status desc