Php 按国家、州、名称字母顺序对数据库中的结果进行排序
我试图从一个数据库中提取“零售商”并按国家显示,美国是第一个。然后,按州的字母顺序排序,然后按每个州的名称排序 它可能会像这样打印 美国Php 按国家、州、名称字母顺序对数据库中的结果进行排序,php,mysql,sorting,Php,Mysql,Sorting,我试图从一个数据库中提取“零售商”并按国家显示,美国是第一个。然后,按州的字母顺序排序,然后按每个州的名称排序 它可能会像这样打印 美国 Alabama Acme Retail Store Another Alphabetized Store Florida Computer Store Wyoming Computer Store Also 阿尔及利亚 Algerian Retail Store 大不列颠 English Retai
Alabama
Acme Retail Store
Another Alphabetized Store
Florida
Computer Store
Wyoming
Computer Store Also
阿尔及利亚
Algerian Retail Store
大不列颠
English Retail Store
等等。。。等等等
我已经正确地从数据库中提取了它,只需要帮助排序
有什么建议吗
order by
case when country = 'usa' then 0 else 1 end asc
, country asc
, state asc
, name asc
我应该这样做