--该时间段的上一条记录
select ID,UserID,UserName,DateTime,OperatorType,Score,Mark,CpsId from t_user_scoredetails where userid=11 and DateTime<'2013-01 00:00:00' order by DateTime desc LIMIT 1
UNION
--时间段的记录
select ID,UserID,UserName,DateTime,OperatorType,Score,Mark,CpsId from t_user_scoredetails where userid=11 and DateTime BETWEEN '2013-01 00:00:00' AND '2013-02 00:00:00'二条语句独立时可以执行,加上Union就报错,不明白为什么,请指点,谢谢
select ID,UserID,UserName,DateTime,OperatorType,Score,Mark,CpsId from t_user_scoredetails where userid=11 and DateTime<'2013-01 00:00:00' order by DateTime desc LIMIT 1
UNION
--时间段的记录
select ID,UserID,UserName,DateTime,OperatorType,Score,Mark,CpsId from t_user_scoredetails where userid=11 and DateTime BETWEEN '2013-01 00:00:00' AND '2013-02 00:00:00'二条语句独立时可以执行,加上Union就报错,不明白为什么,请指点,谢谢
解决方案 »
- 不包含“ReusableTokenStream”的定义
- 关于正则表达式截取字符串
- 如何将按钮隐藏
- 男朋友打我。。。你也打你的女朋友吗?或者你的男朋友也打你吗?
- 在Web中怎麼樣取F1的值
- 后台代码写在什么地方
- [Asp.Net] DataGrid 在最后一页,显示足够的行数。
- 一个奇怪的问题,为什么在dropdownlist触发indexchange事件之后,imagebutton不能点击了?请大家帮忙分析一下,谢谢!!
- JS,键功能替换的问题,请大家给看看, 100分,100分,100分
- 为什么我用DataGrid时,出现”阅读器关闭时 FieldCount 的尝试无效“
- 求.Net压缩GIF图片代码
- 【上传文件至FTP】在线等待
(select ID,UserID,UserName,DateTime,OperatorType,Score,Mark,CpsId from t_user_scoredetails where userid=11 and DateTime<'2013-01 00:00:00' order by DateTime desc LIMIT 1)
UNION
(select ID,UserID,UserName,DateTime,OperatorType,Score,Mark,CpsId from t_user_scoredetails where userid=11 and DateTime BETWEEN '2013-01 00:00:00' AND '2013-02 00:00:00')
加上括号试试