In MariaDB, the IFNULL()
function allows us to replace NULL values with another value.
Category: MariaDB
How NVL() Works in MariaDB
From MariaDB 10.3, NVL()
can be used as an alias for the IFNULL()
function. Therefore, both functions enable us to replace NULL values with another value.
How COALESCE() Works in MariaDB
In MariaDB, the COALESCE()
operator returns the first non-NULL value in the list, or NULL if there are no non-NULL values.
How to Get the End of the Month in MariaDB
In MariaDB, we can use the LAST_DAY()
function to return the last day of a given month.
This could be the last day of the current month, or the last day of the month based on a date that we specify.
Continue reading2 Ways to Return Rows that Only Contain Non-Alphanumeric Characters in MariaDB
Below are two methods for returning rows that contain only non-alphanumeric characters in MariaDB.
Non-alphanumeric characters include punctuation characters like !@#&()–[{}]:;',?/*
and symbols like `~$^+=<>“
, as well as whitespace characters like the space or tab characters.
Return the Number of Days in a Month in MariaDB
Here’s a nifty trick we can use in MariaDB to return the number of days in a month based on a given date.
Continue readingHow to Convert to Uppercase in MariaDB
In MariaDB, we can use the UPPER()
function to convert lowercase characters to their uppercase equivalent.
We can alternatively use UCASE()
, which is a synonym of UPPER()
.
How to Detect if a Value Contains at Least One Numerical Digit in MariaDB
When working with MariaDB, you may occasionally find yourself needing to return all rows that contain at least one numerical digit.
In such cases, you may find the following example useful.
Continue readingFix “ERROR 1136 (21S01): Column count doesn’t match value count at row 1” when Inserting Data in MariaDB
If you find yourself getting an error that reads something like “ERROR 1136 (21S01): Column count doesn’t match value count at row” in MariaDB, it’s probably because you’ve specified the wrong number of expressions for the number of columns in the column when attempting to insert data into a table.
In other words, you’re trying to insert too many columns or not enough columns.
Continue reading7 Ways to Return Duplicate Rows that have a Primary Key in MariaDB
Here are seven ways to return duplicate rows in MariaDB when those rows have a primary key or other unique identifier column.
Therefore, the duplicate rows share exactly the same values across all columns except for their unique identifier column.
Continue reading