Use IFNULL:
IFNULL(expr1, 0)
From the documentation:
If expr1 is not NULL, IFNULL() returns expr1; otherwise it returns expr2. IFNULL() returns a numeric or string value, depending on the context in which it is used.
More Related Contents:
- You can’t specify target table for update in FROM clause
- Generating a range of numbers in MySQL
- How to get next/previous record in MySQL?
- How do I make a row generator in MySQL?
- MySQL INSERT INTO table VALUES.. vs INSERT INTO table SET
- MySQL number of items within “in clause”
- Error 1046 No database Selected, how to resolve?
- What’s the difference between VARCHAR and CHAR?
- Alter a MySQL column to be AUTO_INCREMENT
- Is there something wrong with joins that don’t use the JOIN keyword in SQL or MySQL?
- MySQL ON DUPLICATE KEY UPDATE for multiple rows insert in single query
- Mysql recursion?
- is there a group_concat function in ms-access?
- Is there an alternative to TOP in MySQL?
- How many rows in a database are TOO MANY?
- Why does this SQL code give error 1066 (Not unique table/alias: ‘user’)?
- Is it possible to have an indexed view in MySQL?
- mysql – how many columns is too many?
- Best database field type for a URL
- Use A Union Or A Join – What Is Faster [closed]
- MySQL – how to front pad zip code with “0”?
- Find the number of columns in a table
- Mysql, reshape data from long / tall to wide
- MySQL: Compare differences between two tables
- Mysql strip time component from datetime
- How do I start auto increment from a specific point?
- What’s the correct name for an “association table” (a many-to-many relationship) [closed]
- sql pulling a row for next or previous row of a current row
- Row Rank in a MySQL View
- Select Rows with Maximum Column Value group by Another Column