In MariaDB, EXTRACT() is a built-in date and time function that returns the specified unit from a given date or datetime expression.
Ian
How DAYOFYEAR() Works in MariaDB
In MariaDB, DAYOFYEAR() is a built-in date and time function that returns the day of the year from a given date.
It accepts one argument, which is the date you want to extract the day of the year from.
It returns the day as a number in the range 1 to 366.
How WEEKDAY() Works in MariaDB
In MariaDB, WEEKDAY() is a built-in date and time function that returns the week day from a given date.
It accepts one argument, which is the date you want to extract the week day from.
It returns the day as a number. The index numbering starts at zero for Monday (i.e. 0 = Monday, 1 = Tuesday, etc). This is in contrast to DAYOFWEEK(), which adheres to the ODBC standard (1 = Sunday, 2 = Monday, etc).
How DAYOFWEEK() Works in MariaDB
In MariaDB, DAYOFWEEK() is a built-in date and time function that returns the day of the week from a given date.
It accepts one argument, which is the date you want to extract the day of the week from.
It returns the day as a number. The index numbering adheres to the ODBC standard (1 = Sunday, 2 = Monday, etc). This is in contrast to WEEKDAY(), where 0 = Monday, 1 = Tuesday, etc.
How MONTHNAME() Works in MariaDB
In MariaDB, MONTHNAME() is a built-in date and time function that returns the name of the month name for a given date.
It accepts one argument, which is the date you want to extract the month name from.
6 Ways to Add a Month to a Date in MariaDB
MariaDB provides several ways to perform arithmetic on dates. This includes adding or subtracting a month (or many months) from a given date.
Here are 6 ways to add a month to a date in MariaDB.
Bonus update: I’ve now added a 7th way to add a month to a date at the end of this article. So I guess it’s now 7 ways to add a month to a date in MariaDB 🙂
How to do an UPDATE Pass-Through Query in SQL Server
In SQL Server, the OPENQUERY rowset function enables you to execute a pass-through query on a linked server.
OPENQUERY is commonly referenced in the FROM clause of a query as if it were a table, but it can also be referenced as the target table of an INSERT, UPDATE, or DELETE statement.
This article presents an example of using OPENQUERY to do an UPDATE pass-through query.
How DAYNAME() Works in MariaDB
In MariaDB, DAYNAME() is a built-in date and time function that returns the name of the weekday for a given date.
It accepts one argument, which is the date you want to extract the day name from.
Return the Language used for Date & Time Functions in MariaDB
MariaDB has a lc_time_names system variable that controls the language used by the DAYNAME(), MONTHNAME() and DATE_FORMAT() date and time functions.
Here’s how to return the value of that variable.
MariaDB DAY() Explained
In MariaDB, DAY() is a synonym for DAYOFMONTH(). It returns the day of the month from a given date.