Home >Database >Mysql Tutorial >查询给定日期是当年的第几季度sql语句

查询给定日期是当年的第几季度sql语句

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:47:441862browse

查询给定日期是当年的第几季度sql语句

declare @date datetime;
set @date = getdate()
select datepart(quarter,@date) [quarterofyear]; --返回int型
select datename(quarter,@date) [quarterofyear]; --返回varchar型
go
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn