Here are three ways to return the month name from a date in MariaDB.
Continue readingCategory: DBMS
Database Management Systems
How LAST_DAY() Works in MariaDB
In MariaDB, LAST_DAY()
is a built-in date and time function that returns the last day of the month for a given date.
It accepts one argument, which is the date for which you want to find the last day of the month.
Continue readingSubtract a Month from 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’s an example of subtracting a month from a date in MariaDB.
Continue readingHow QUARTER() Works in MariaDB
In MariaDB, QUARTER()
is a built-in date and time function that returns the quarter from a given date expression.
It accepts one argument, which is the date you want to extract the quarter from.
It returns the quarter as a number in the range 1
to 4
. For dates with zero months (e.g. 0000-00-00
or 2025-00-00
), the result is 0
.
2 Ways to Get the Default Language of a Login in SQL Server (T-SQL)
There are (at least) a couple of ways you can use T-SQL to return the default language of a specified login in SQL Server.
In particular, you can use the following methods:
- Query the
LOGINPROPERTY()
function. - Query the
sys.server_principals
system catalog view in themaster
database.
Examples of these are below.
Continue readingHow YEAR() Works in MariaDB
In MariaDB, YEAR()
is a built-in date and time function that returns the year from a given date expression.
It accepts one argument, which is the date you want to extract the year from.
It returns the year as a number in the range 1000
to 9999
. For zero dates (e.g. 0000-00-00
), the result is 0
.
Rename a User Defined Data Type in SQL Server (T-SQL)
In SQL Server, you can use the sp_rename
stored procedure to rename a user created object in the current database, including a user-defined data type.
How WEEKOFYEAR() Works in MariaDB
In MariaDB, WEEKOFYEAR()
is a built-in date and time function that returns the calendar week of a given date as a number in the range from 1
to 53
.
It’s the equivalent of using the WEEK()
function in mode 3, and therefore its result is in accordance with ISO 8601:1988.
It accepts one argument; the date you want to extract the week from.
Continue readingHow YEARWEEK() Works in MariaDB
In MariaDB, YEARWEEK()
is a built-in date and time function that returns the year and week for a given date.
It accepts two arguments; the date you want to extract the year and week from, and an optional mode argument to specify the mode to use in the result.
It returns the week as a number in the range 0
to 53
or 1
to 53
, depending on the mode being used. Also, the year in the result may be different from the year in the date argument for the first and the last week of the year.
How WEEK() Works in MariaDB
In MariaDB, WEEK()
is a built-in date and time function that returns the week from a given date expression.
It accepts two arguments; the date you want to extract the week from, and an optional mode argument to specify the mode to use in the result.
It returns the week as a number in the range 0
to 53
or 1
to 53
, depending on the mode being used.