Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql default value if null

SELECT IFNULL(column_name, default_value 'Test') AS alias FROM table; 
--example
SELECT
        first_name,
        IFNULL(title, 'MISSING') as title,
        IFNULL(grade, 0) as grade
FROM students
 
PREVIOUS NEXT
Tagged: #sql #default #null
ADD COMMENT
Topic
Name
7+6 =