【发布时间】:2015-11-10 00:18:57
【问题描述】:
我有一张表,我正在尝试在 name 上使用“apple m”过滤值
select * from table where name like '%apple%m%'
+-------+-------------------------------+------------------------+
| id | name | cat |
+-------+-------------------------------+------------------------+
| 2757 | Apple MacBook | Laptops & Accessories |
| 2777 | Apple Bottom Tops | Western Wear |
| 2752 | Apple Monitors | Desktop Components |
| 2756 | Apple Desktop & Monitors | Desktops & Accessories |
| 2778 | Apple Bottom Tunics | Tops |
| 2776 | Apple Selector & Smart Box | Video & TV Accessories |
| 2787 | Apple Pie Pyjamas | Girl Clothes |
| 2773 | Apple Selector & Smart Box | TV & Video Accessories |
| 2780 | Apple Fun Card Games | Toys |
| 38304 | Snapple Mixer juicer grinders | Kitchen Appliances |
+-------+-------------------------------+------------------------+
我想对以“apple”和“m”开头的显示值进行排序,如下所示:
+------+--------------------------+------------------------+
| id | name | cat |
+------+--------------------------+------------------------+
| 2757 | Apple MacBook | Laptops & Accessories |
| 2752 | Apple Monitors | Desktop Components |
| 2756 | Apple Desktop & Monitors | Desktops & Accessories |
| | ---Rest all after this-- | |
+------+--------------------------+------------------------+
【问题讨论】:
-
为什么
Apple Monitors后面有Apple Desktop?D位于M之前。
标签: mysql mysql-workbench