In MariaDB, you can use the DATE_FORMAT() function to return various date parts from a date. One of the things you can return is the short day name. For example Tue or Wed (instead of Tuesday or Wednesday).
Relational
Return the Current Workstation Name that’s Connected to SQL Server (T-SQL)
Occasionally you might find yourself in the situation where you need to get the name of the current workstation that’s connected to SQL Server.
For example, maybe you have a stored procedure that inserts data, and you want to record the name of the workstation that inserted the data.
In such cases, you can use the HOST_NAME() function.
This is not to be confused with getting the server name.
MariaDB FIELD() vs FIND_IN_SET(): What’s the Difference?
Two similar functions in MariaDB are FIELD() and FIND_IN_SET(). At first glance, these appear to do the same thing, but there is a difference.
This article looks at the difference between these two functions.
MariaDB LENGTH() vs LENGTHB(): What’s the Difference?
Ever since version 10.3.1, MariaDB has included both a LENGTH() function and a LENGTHB() function.
That second one has a B at the end of the name. So it’s kind of like Length A and Length B, except that Length A doesn’t have the A.
Confused?
I was, when I first encountered LENGTHB(). I already knew about LENGTH(), so why the need for a “B” version?
Let’s find out.
MariaDB JSON Functions
Below is a list of the JSON functions available in MariaDB.
Change the Time Zone Offset on a datetimeoffset Value in SQL Server (T-SQL)
You can use the SWITCHOFFSET() function in SQL Server to change the time zone offset on a datetimeoffset value.
The function accepts two arguments; a datetimeoffset(n) value (or an expression that can be resolved to a datetimeoffset(n) value), and the new time zone.
4 Functions to Get the Hour from a Time Value in MariaDB
Below are 4 functions that enable you to return the hour from a time value in MariaDB.
Replace Multiple Characters in a String in SQL Server (T-SQL)
In SQL Server, the REPLACE() function enables us to replace a string with another string. But what if you want to replace a list of characters with another list of characters?
The TRANSLATE() function might help.
8 Functions to Return the Day from a Date in MariaDB
MariaDB has quite a number of functions that return the day from a date. It all depends on how you want to do it, and what you mean by “day”.
MariaDB needs to know whether you want the day name, the day of the week number, the day of the month, day of year, etc.
Below are 8 functions that enable you to return the day from a date in MariaDB, in its various forms.
MariaDB JSON_VALID() Explained
In MariaDB, JSON_VALID() is a built-in function that allows you to check whether or not a value is a valid JSON document.
You pass the value as an argument, and JSON_VALID() returns 1 if it’s a valid JSON document, and 0 if not.