14,970
edits
| Line 91: | Line 91: | ||
=== is null === | === is null === | ||
Fill 0 if the value is NA or NULL | |||
* MySQL SQL syntax: {{kbd | key = SELECT COALESCE(column_name, 0) }} Using [http://www.w3resource.com/mysql/comparision-functions-and-operators/coalesce-function.php COALESCE() function] to replace the NULL value with 0. | |||
* python: [http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.fillna.html pandas.DataFrame.fillna — pandas 0.16.0 documentation] "Fill NA/NaN values using the specified method" | |||
Find whether a variable is NULL. [http://ideone.com/tKv2gQ online demo] | |||
* PHP [http://tw2.php.net/is_null is_null] | * PHP [http://tw2.php.net/is_null is_null] | ||
* Google spreadsheet / Excel: | * Google spreadsheet / Excel: | ||
| Line 98: | Line 102: | ||
* MySQL SQL syntax: {{kbd | key = SELECT * FROM table WHERE column IS NULL;}}<ref>[http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html MySQL :: MySQL 5.0 Reference Manual :: 3.3.4.6 Working with NULL Values]</ref> | * MySQL SQL syntax: {{kbd | key = SELECT * FROM table WHERE column IS NULL;}}<ref>[http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html MySQL :: MySQL 5.0 Reference Manual :: 3.3.4.6 Working with NULL Values]</ref> | ||
Find whether a variable is NOT NULL | |||
* MySQL SQL syntax: {{kbd | key = SELECT * FROM table WHERE column IS NOT NULL;}} | * MySQL SQL syntax: {{kbd | key = SELECT * FROM table WHERE column IS NOT NULL;}} | ||