This article contains a full list of built-in MariaDB date and time functions.
Continue readingCategory: Relational
Get the Language Currently Being Used in SQL Server
There are several ways to get the language currently being used in SQL Server.
The language of the current session will often be the default language for the login, but this is not necessarily always the case. A user can change the current language during the session.
Also, some of SQL Server’s built-in functions accept an argument that allows you to specify a language for that specific query.
This article shows you how to return the language currently being used.
Continue readingHOUR() vs EXTRACT(HOUR …) in MariaDB: What’s the Difference?
MariaDB has an HOUR()
function that extracts the hour portion from a time value. MariaDB also has an EXTRACT()
function that can also extract the hour portion from a time value.
However, these functions don’t always return the same result.
Read on to see the difference between HOUR()
and EXTRACT(HOUR FROM ...)
in MariaDB.
Get the Day of the Year from a Date in SQL Server (T-SQL)
TSQL provides the DATEPART()
function, which enables us to return the day of the year for a given date in SQL Server.
By “day of the year”, I mean the day number of the given year.
Continue readingDifference Between TRIM() and TRIM_ORACLE() in MariaDB
MariaDB has a TRIM()
function and a TRIM_ORACLE()
function. Both functions do essentially the same thing. But there is a minor difference.
4 Functions that Extract Microseconds from a Time Value in MariaDB
Below are 4 functions that enable you to return the microseconds part from a time value in MariaDB.
Continue readingHow SLEEP() Works in MariaDB
In MariaDB, SLEEP()
is a built-in function that sleeps (pauses) for the number of seconds specified by its argument.
If uninterrupted, it returns 0
, if interrupted, it returns 1
.
3 Ways to Get the Day Name from a Date in MariaDB
Below are three approaches you can use to get the day name from a date in MariaDB.
Two of these approaches return the full day name, and one returns the short day name.
Continue readingFix: “Unknown table ‘locales’ in information_schema” in MariaDB
If you get the Unknown table 'locales' in information_schema
error in MariaDB, it’s probably because you haven’t installed the LOCALES
plugin yet.
You need to install the LOCALES
plugin before you try to query this table.
How OCT() Works in MariaDB
In MariaDB, OCT()
is a built-in function that returns a string representation of the octal value of its argument.