Most major RDBMSs support the COALESCE()
operator, which returns the first non-null value from its list of arguments.
COALESCE()
is a SQL-standard feature (it’s included in the ISO/IEC 9075 specification).
Most major RDBMSs support the COALESCE()
operator, which returns the first non-null value from its list of arguments.
COALESCE()
is a SQL-standard feature (it’s included in the ISO/IEC 9075 specification).
Sometimes you might need to search a database table for only those rows that contain at least one number in a given column.
Technically, numbers can be represented by words and other symbols, but here “number” means “numerical digit”.
Below are examples of how to find rows that contain at least one number in various SQL based DBMSs.
Continue readingThe following SQLite examples return only those rows that have non-numeric values in a given column.
Continue readingWe can use SQLite’s DATE()
function to return the first Monday of each month for a given year, based on the date we provide.
But it’s not limited to Monday. We can also get the first Tuesday, Wednesday, Thursday, Friday, etc of each month.
Continue readingSQLite provides several functions for inserting, setting, and replacing values in a JSON document. Specifically, it provides json_insert()
, json_set()
, and json_replace()
.
These functions perform similar tasks, and you can sometimes use them interchangeably to a certain point.
But there is definitely a clear difference between each function.
Continue readingWe can use SQLite’s DATE()
function to perform calculations on a given date. One of the things we can do is return the first, second, third, or fourth instance of a given day within a given month.
The following SQLite example returns all rows that contain at least one numerical digit.
Continue readingWhen using SQLite, we can use the following methods to extract data from a JSON document.
Continue readingIn SQLite, we can use the DATE()
function to subtract one or more days from a date.
For datetime values, we can use the DATETIME()
function.
In SQLite, we can use the DATE()
function to add one or more months to a date.
When we’re dealing with datetime values, we can use the DATETIME()
function.