MySQL IFNULL() function usage in SELECT queries

We all know as SQL professionals that the NULL marker is a special case. Oftentimes, you have NULL‘s stored in your tables, and that’s fine. Suppose you want to present an alternative value in query results where some of the columns have NULL? This is a perfect opportunity (but not the only) to use the IFNULL() function. I find IFNULL() quite useful when exporting query results to a CSV file or other type of flat file, providing something more meaningful than the NULL word itself. However, you only have one substitute for the NULL value when using IFNULL(), so keep that in…

--

--

--

SQL and PHP/CodeIgniter Developer. Growing through Technical Writing and Blogging. Sign-up for my free newsletter here: openlamptech.substack.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Docker with Terraform on Clouds GCP and AWS

Exploring Zenity

Distributed Tracing and its place in the monitoring landscape

How to Create a Chatbot with Dialogflow, NodeJS, and Webhook

NumPy……

READ/DOWNLOAD*- VMware vSphere 6.7 Clustering Deepdive FULL BOOK PDF & FULL AUDIOBOOK

The Summary of Stage 1 Beta Testing

Linked Lists to the Rescue

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Joshua Otwell

Joshua Otwell

SQL and PHP/CodeIgniter Developer. Growing through Technical Writing and Blogging. Sign-up for my free newsletter here: openlamptech.substack.com

More from Medium

How to do Karate setup?

Testing your data migrations from SSMS to Azure Cloud (for Beginners)

Rewrite stored procedure example with SQL refactoring

SQL 4주차