标签: sql select null sql-order-by h2
如何在H2 DBMS中首先选择按NULL排序的数据?
答案 0 :(得分:4)
使用NULLS FIRST:
NULLS FIRST
select * from the_table order by some_column NULLS FIRST;
order by ... nulls first/last是ANSI SQL,受H2支持
order by ... nulls first/last
有关详细信息,请参阅手册:http://www.h2database.com/html/grammar.html#order