mysql 无法使用 nulls first 和nulls last 的解决方案
·
mysql不能像oracle一样,使用nulls first 和nulls last,可以使用下面的语句代替
nulls first
null放前面
order by IF(ISNULL(my_field),0,1), my_field;
nulls last
null放后面
order by IF(ISNULL(my_field),1,0),my_field;
转至:https://blog.csdn.net/shentian885/article/details/121419535
更多推荐
所有评论(0)