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.
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.
Below are six examples that delete duplicate rows from a table in SQLite when those rows have a primary key or unique identifier column.
In these instances, the primary key must be ignored when comparing duplicates (due to the fact that primary keys prevent duplicate rows by definition).
Continue readingIn Oracle Database we can use the LAST_DAY()
function to return the last day of a given month. This can be the last day of the current month or the last day of month based on a specified date.
We can use MySQL’s 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 readingWhen using one of SQLite’s tabular output modes, you can enable the --wrap
option in order to limit the width of each column. This can be handy when the data contains long lines of text.
When we do this, we have the option of specifying “word wrap”, so that words don’t get cut off halfway through.
There are two ways to specify word wrap: use --wordwrap on
or its shortcut -ww
.
The ->
and ->>
operators were introduced in SQLite version 3.38.0, which was released on 22 February 2022. Both operators are used for extracting subcomponents of JSON. But there’s a subtle difference between them.
Here’s an example of using PostgreSQL to return the number of days in a month, based on a given date.
Continue readingIn PostgreSQL, we can use the upper()
function to convert lowercase characters to their uppercase equivalent, according to the rules of the database’s locale.
In PostgreSQL, we can use the lower()
function to convert uppercase characters to their lowercase equivalent, according to the rules of the database’s locale.
We can use the following method in PostgreSQL to return the first day of a given month.
This could be the first day of the current month, or the first day of the month based on a date that we specify.
Getting the first day of the month allows us to perform further calculations on the resulting date, like adding a certain number of days to the start of the month, etc.
Continue reading