About the DATE_BUCKET() Function in Azure SQL Edge

T-SQL includes a DATE_BUCKET() function that allows you to arrange data into groups that represent fixed intervals of time. It returns the datetime value that corresponds to the start of each datetime bucket, as defined by the arguments passed to the function.

As far as I’m aware, the DATE_BUCKET() function is only available in Azure SQL Edge at the time of this writing.

Update: DATE_BUCKET() was introduced in SQL Server 2022.

Continue reading

Difference Between SYSDATE() and NOW() in MariaDB

In MariaDB, the SYSDATE() and NOW() functions are similar in that they return the current date and time.

However, there is an important difference: SYSDATE() returns the time that it executes, whereas NOW() returns the time that the statement started executing.

And when run within a stored procedure or trigger, SYSDATE() will return the time that it executes, whereas NOW() will return the time that the stored procedure or trigger started executing.

Continue reading