Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can anyone explain how to replace NULL values with ‘0’ in SQL?

1 Answer

0 votes
by (119k points)

In SQL, you can use ISNULL () function to replace the NULL values with any value. Here is the syntax for replacing NULL values with zero:

SELECT ISNULL (Column_name , 0 )

FROM Table_Name;

You can also use COALESCE() function to replace NULL values and the following is the syntax for that:

SELECT COALESCE (Column_name , 0 )

FROM Table_Name;

If you want to take a course that can provide Instructor-led training and certification then sign up for this SQL Certification program by Intellipaat.

Related questions

Browse Categories

...