創建一個表格
如果希望按照Id有序
mysql> CREATE TABLE `test_b` (
Query OK
mysql> insert into test_b values(
Query OK
Records:
mysql> select * from test_b;
+
| Id | Type |
+
|
|
|
|
|
+
mysql> select * from test_b force index (primary);
+
| Id | Type |
+
|
|
|
|
|
+
觀察select * from test_b的前兩條結果
mysql> insert into test_b values(
Query OK
Records:
mysql> select * from test_b ;
+
| Id | Type |
+
|
|
|
|
|
|
|
|
+
默認情況下為什麼會結果按照索引列有序呢?這還要從數據庫內部的運行機制說起
當Type列的值一致的時候
From:http://tw.wingwit.com/Article/program/MySQL/201311/29567.html