Sql Query只选择特定的月份 [英] Sql Query to select only particular month

查看:92
本文介绍了Sql Query只选择特定的月份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们





我的数据库有12个月的数据现在我想只挑选一个月的数据说我想要2013年6月的报告该用户的查询将选择月份和年份

Dear friends


I have data base having data for 12 months now i want to pick the data only for one month say i want report of june 2013 what is the query for that user will select month and year

推荐答案

示例:

Example:
SELECT *
FROM TableName
WHERE MONTH(DateColumn)=@month AND YEAR(DateColumn)=@year


从学生中选择*月份(12_march_2010)= @ month
Select * from student where month (12_march_2010)=@month


这篇关于Sql Query只选择特定的月份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆