support order NULL by first or last