Below are examples of using SQL to return the last day of the month across various DBMSs.
This could be the last day of the current month, or the last day of a month based on a given date.
Continue readingBelow are examples of using SQL to return the last day of the month across various DBMSs.
This could be the last day of the current month, or the last day of a month based on a given date.
Continue readingBelow are the steps that I used to install Redis on my M1 Mac. The M1 Mac (and M2) uses the ARM64 architecture, but this is not a problem, as Redis versions 4.0 and above support the ARM architecture.
Continue readingIn SQLite we can use the lower()
function to convert uppercase characters to lowercase.
Here are examples of using SQL to return duplicate rows when those rows have a primary key or other unique identifier column.
These queries work in most of the major RDBMSs, including SQL Server, Oracle, MySQL, MariaDB, PostgreSQL, and SQLite.
Continue readingIf you have a generated column in PostgreSQL, you can use the following methods to find the definition of that column.
Continue readingIn SQLite, we can use the DATE()
function to add one or more years to a date.
For datetime values, we can use the DATETIME()
function.
Most RDBMSs provide at least a few ways to return rows that contain lowercase characters. Here are some options available in the major RDBMSs.
Continue readingIn PostgreSQL, a generated column is a special column that is always computed from other columns. A generated column doesn’t have a fixed value like in a base column. Rather, its value is determined by an expression that references other columns in the table.
Generated columns are included in the SQL standard (ISO/IEC 9075), and are supported by most major RDBMSs. Generated columns were first introduced in PostgreSQL 12.
Continue readingHere’s an example of using SQL to find duplicate rows in a database table. This technique can be used in most of the major RDBMSs, including SQL Server, Oracle, MySQL, MariaDB, PostgreSQL, and SQLite.
Continue readingA generated column is one whose value is derived from an expression, as opposed to a fixed value. The expression typically uses other columns in the same table to compute the derived value.
We can create a generated column in MySQL very easily. But what if we want to go back later and see its definition?
Here are two options for returning the definition of a generated column in MySQL.
Continue reading