RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip: Understanding Null Values Returned in MySQL

Learn why the null value often needs special attention in your code to work effectively.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

The null value often needs special attention in your code to work effectively.

For developers, it is important to know if the value that was received for a query is null or not. However, different programming languages handle the return of null values differently. With MySQL, it becomes easier as you can tell what to return in case of null and not null. This makes your programming logic easier, better and more effective.

SELECT ISNULL(column_name) FROM `database_name`.`table_name`;

Here, ISNULL will populate the column value with 0 if the value is null and with 1 if the value is not null. Based on this, we can handle null cases effectively in our code.


Visit the DevX Tip Bank


Sridhar M S. is a Java developer from Bangalore, India. He holds a master's degree in Computer Science.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date