我已經開始學習MySQL了。MySQL - 選擇按字母順序排列的名字
下面是表world
:
+-------------+-----------+---------+
| name | continent | area |
+-------------+-----------+---------+
| Afghanistan | Asia | 652230 |
| Albania | Europe | 2831741 |
| Algeria | Africa | 28748 |
| ... | ... | ... |
+-------------+-----------+---------+
我需要:
每個大洲和國家的自帶首字母順序排列
SELECT的結果必須名單成爲:
+---------------+---------------------+
| continent | name |
+---------------+---------------------+
| Africa | Algeria |
| Asia | Afghanistan |
| Caribbean | Antigua and Barbuda |
| Eurasia | Armenia |
| Europe | Albania |
| North America | Belize |
| Oceania | Australia |
| South America | Argentina |
+---------------+---------------------+
這也是正確的答案! – Dylan
,比我的簡單:) – Parado
你不需要ORDER BY語句。 – unlucy7735