본문 바로가기
Database/PostgreSQL

[PostgreSQL] COALESCE null to 0

by pcm9881 2023. 4. 24.

사용방법

SELECT COALESCE(column, 0);

 

 

예제

SELECT COALESCE(null, 0); -- 0

 

 

 

[PostgrSQL Tutorial COALESCE]: https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-coalesce/

 

PostgreSQL COALESCE

Summary: in this tutorial, you will learn about the PostgreSQL COALESCE function that returns the first non-null argument. You will learn how to apply this function in SELECT statement to handle null values effectively. PostgreSQL COALESCE function syntax

www.postgresqltutorial.com

 

728x90

댓글