select FTitle,YEAR(FTime) as `year`,MONTH(FTime) as `month` from T_DOC_Document where FOrgID='3' and YEAR(FTime)='2021'
SQL查询前,FTime字段格式:“年-月-日 时:分:秒”
SQL查询后,将FTime字段分为year+month
select FTitle,YEAR(FTime) as `year`,MONTH(FTime) as `month` from T_DOC_Document where FOrgID='3' and YEAR(FTime)='2021'
SQL查询前,FTime字段格式:“年-月-日 时:分:秒”
SQL查询后,将FTime字段分为year+month
本文标题:SQL之按照年月查询数据
本文链接:https://www.haomeiwen.com/subject/dnkvwltx.html
网友评论