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.

Continue reading

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.

Continue reading

How to Show all Locales in MariaDB

MariaDB supports a large list of locales that are used by functions such as DAYNAME(), MONTHNAME() and DATE_FORMAT().

While these locales are available to MariaDB, by default they’re not loaded into any of the system tables, so you can’t run a query to retrieve them.

However, MariaDB provides a plugin that does load these into a table. Once the plugin has been installed, you can query that table to return the locales available in MariaDB.

Continue reading