PostgreSQL provides us with several ways to get the day, month, and year from a date.
Three functions that immediately come to mind are; DATE_PART()
, EXTRACT()
, and TO_CHAR()
.
PostgreSQL provides us with several ways to get the day, month, and year from a date.
Three functions that immediately come to mind are; DATE_PART()
, EXTRACT()
, and TO_CHAR()
.
When using SQLcl with Oracle Database, you can export your query results to an XML file with the SPOOL
command.
MySQL has a bunch of different functions that enable us to get various date parts – such as the day, month, and year – from a date.
Continue readingIn MySQL, YEAR()
is a built-in date and time function that returns the year from a given date expression.
It returns the year as a number in the range 1000
to 9999
. For zero dates, it could return 0
or NULL
with a warning, depending on the values in your sql_mode
.
Here’s an example of formatting a number as currency in MariaDB.
Continue readingSome DBMSs provide us with the ability to format a number as a currency by providing a format specifier for the currency symbol. Providing such a format specifier allows the DBMS to return the appropriate currency symbol for the locale.
MySQL doesn’t have a currency format specifier, and so we need to do a bit of extra work if we want the currency symbol to be returned.
Continue readingBelow are the steps that I used to install MySQL on my M1 Mac via the Homebrew package manager.
As mentioned, this is an M1 Mac (which uses the ARM64 architecture) but that didn’t cause any issues. The current version (MySQL 8.0.26) supports the ARM architechure.
Continue readingIn MySQL, you can use the DATE_FORMAT()
function with the %b
format specifier to return the short month name. For example, you can return Jan
or Feb
instead of January
or February
.
Microsoft Azure SQL Edge’s backup capabilities are similar to those in SQL Server on Linux, and SQL Server running in containers.
Azure SQL Edge supports T-SQL, and so you can back up your SQL Edge databases by running a T-SQL statement.
In this article, I back up a SQL Edge database to the local disk in my Docker container.
Continue readingHere’s a list of MySQL format specifiers that can be used in format strings with functions like DATE_FORMAT()
, STR_TO_DATE()
, and UNIX_TIMESTAMP()
.