我们如何在mysql中最后输出null

时间:2018-06-28 07:49:02

标签: mysql null oracle12c

我有一个下面提到的oracle查询,其中批量记录是varchar(600),activation_member_key是bigint,优先级是INT。在此查询中,我需要按activation_member_key和优先级desc来打印批量记录顺序,最后是null。请帮助我,如何在MySQL 5.7中最后打印空值。这是oracle中的查询:

select replace(replace(bulk_record, CHR(13), ''), CHR(10), '') as BULK_RECORD 
from eamp.temp_hlth_stmt_bulk 
order by activation_member_key, priority desc nulls last

1 个答案:

答案 0 :(得分:0)

似乎您只选择BULK_RECORD,所以按activation_member_key和优先级排序并不重要?我想你可以拥有

SELECT replace(replace(bulk_record, CHR(13), ''), CHR(10), '') as BULK_RECORD 
FROM eamp.temp_hlth_stmt_bulk 
ORDER BY BULK_RECORD ASC NULLS LAST

除非我缺少任何东西。您当前的查询返回什么?