Collections:
QUARTER() - Quarter of Year
How to extract the quarter of year from a given date using the QUARTER() function?
✍: FYIcenter.com
QUARTER(date) is a MySQL built-in function that
returns the quarter of year from a given date.
For example:
SELECT QUARTER('2023-02-03'), QUARTER(NOW()), NOW();
-- +-----------------------+----------------+---------------------+
-- | QUARTER('2023-02-03') | QUARTER(NOW()) | NOW() |
-- +-----------------------+----------------+---------------------+
-- | 1 | 4 | 2023-11-15 09:51:50 |
-- +-----------------------+----------------+---------------------+
Reference information of the QUARTER() function:
QUARTER(date): int Returns the quarter of the year for date, in the range 1 to 4. Arguments, return value and availability: date: Required. The date to extract the quarter of year from. int: Return value. The quarter of year. Available since MySQL 4.
Related MySQL functions:
⇐ PERIOD_DIFF() - Difference of Year-Month Periods
2023-11-17, 1112🔥, 0💬
Popular Posts:
What Is Program Global Area (PGA) in Oracle? A Program Global Area (PGA) is a memory buffer that is ...
What is SQL Server Transact-SQL (T-SQL)? SQL Server Transact-SQL, also called T-SQL, is an extension...
How To Select All Columns of All Rows from a Table with a SELECT statement in SQL Server? The simple...
How To Use "IF ... ELSE IF ..." Statement Structures in SQL Server Transact-SQL? "IF ... ELSE IF ......
How To Assign Debug Privileges to a User in Oracle? In order to run SQL Developer in debug mode, the...