Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
返回给定日期值对应的季度,取值范围 1 到 4。
INT quarter(DATETIME|DATE date);
date
SELECT QUARTER("2022-10-09 15:59:33"); +--------------------------------+ | quarter('2022-10-09 15:59:33') | +--------------------------------+ | 4 | +--------------------------------+
SELECT QUARTER("2022-10-09"); +-----------------------+ | quarter('2022-10-09') | +-----------------------+ | 4 | +-----------------------+
SELECT QUARTER(NOW()); +----------------+ | quarter(now()) | +----------------+ | 4 | +----------------+ SELECT QUARTER(CURDATE()); +--------------------+ | quarter(curdate()) | +--------------------+ | 4 | +--------------------+