Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在从表中选择一列的最大值。但是有一个问题:如果表中没有行,则返回null。
我想使用一个函数,如果结果为空,它将返回某个值。例如,对于 Oracle,NVL如果该列为空,则该函数会给出某个值。MySQL 中是否有等效功能?
NVL
使用合并:
select coalesce(column_name, 'NULL VALUE') from the_table