select * from orders where( OrderDate between '2007-1-1' and '2007-6-30') or (OrderDate between '2007-7-1' and '2007-7-31') or (OrderDate between '2007-8-1' and '2007-8-31')
解决方案 »
- 画UML图一般用啥工具
- winform中 textbox键盘控制问题
- 未处理ArgumentException 参数无效 C#
- 想学习SQL Server Reporting Service技术,听说可以从SQL Server 2005安装,大家可以谈谈使用经验不?
- 请教关于listview的问题???
- 救救我啊,怎么在IE客户端没有权限写服务器端XML文件呢????
- 如何将ImageCodecInfo标记为可序列化???
- zedgraph控件滚动条自动滚动
- c++和c#的语法转换
- 救命啊~~
- openfiledialogde 的showdialog方法
- 学习api的新手,请问高手这样调用哪里有问题?系统提示TypeLoadException
select * from orders where (DATEPART(year,OrderDate)=2007 and ((DATEPART(month,OrderDate) between 1 and 6) or DATEPART(month,OrderDate)=7 or DATEPART(month,OrderDate) = 8 ))
select right(Convert(varchar(4),year(日期字段)),2)+Convert(varchar(2),month(日期字段))
建议加一张表,这表的结构就是你的条件以前经常给用户发奖,发奖就有众多各类条件============================
表table_aID sTime
1 2007-03-01
2 2007-10-01表table_bbegintime endtime
2007-06-01 2007-07-01
2007-08-01 2007-09-30然后么自己看着办咯select * from table_a as t1,table_b as t2 where t1.stime < t2.endtime and t1.stime>t2.begintime呵呵,这样就找到了你想要的因为考虑到你的条件不确定,所以,这样的方式扩展性很好,随便条件你都可以