1、一般的order by 语句其返回的结果为
SELECT `vcenter_ip`, `status`, `sla_id` FROM vm_list ORDER BY sla_id ASC;
2、这个很显然不是我想要的结果,修改SQL如下[红色为关键语句]
SELECT `vcenter_ip`, `status`, `sla_id` FROM vm_list ORDER BY sla_id is NULL, sla_id = 0, sla_id ASC;
1、一般的order by 语句其返回的结果为
SELECT `vcenter_ip`, `status`, `sla_id` FROM vm_list ORDER BY sla_id ASC;
2、这个很显然不是我想要的结果,修改SQL如下[红色为关键语句]
SELECT `vcenter_ip`, `status`, `sla_id` FROM vm_list ORDER BY sla_id is NULL, sla_id = 0, sla_id ASC;