本文介绍了SQL 显示两个日期之间的月份和年份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
我有四个变量 CurrentMonth、CurrentYear、Month、year.我想要一个 SQL 语句,它显示 (Month,Year) 到 (currentMonth,CurrentYear) 之间的所有月份和年份.下面显示月份,但我需要月份和年份,我没有日期,但只有开始和结束的月份和年份.
I have four variables CurrentMonth, CurrentYear, Month, year. I want to have a SQL statement which displays all the months and years between (Month,Year) to (currentMonth,CurrentYear). The below displays months but I need months and year and I dont have dates but only month and year of start and End.
推荐答案
这是对上一个回答的修改,来自 indicently 以满足您的月/年需求.
This is a modification from the previous answer from indicently to meet your Month/Year needs.
这篇关于SQL 显示两个日期之间的月份和年份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!