MySQL ORDER BY 使用自定义排序顺序

ORDER BY 子句可以使用FIELD() 函数为列中的值定义自定义的排序顺序。

例如下表:

+----------------+
| orders         |
+----------------+
| orderNumber    |
| orderDate      |
| requiredDate   |
| shippedDate    |
| status         |
| comments       |

你可能感兴趣的:(SQL学习笔记,mysql,数据分析)