In a query has many fields unfilled, I would like to change the null
being printed so that nothing appears in the print.
In a query has many fields unfilled, I would like to change the null
being printed so that nothing appears in the print.
Use the COALESCE
function:
COALESCE(coluna, '')
The result of this function is the first of the two non-null arguments, so if the first one is not, get the value of the column, otherwise get the string empty. This can be used in any part of the query.
Example:
SELECT nome, COALESCE(endereco, '') AS endereco FROM tabela