select a,b from tableorder by (case when a is null then 0 else 1 end),nvl(length(trim(b)),0);a为空时自动排在最前,之后按升序排列b按照值长度从小到大排列