分享 刚发现的2000和2005 的区别

kuangtu007 2008-06-06 10:17:35
select convert(char(10), actdate, 111) actdate, * from YDBDLIST where sc#='B86055600' and item='1' 
and substring(convert(char(10), actdate, 111),6,2) = right('00'+ltrim(str(MONTH('20080606'))), 2 )
and status<>'D1' and p_flag<>'C' order by actdate desc


---------------------
在2000里执行没问题 ,在2005例执行会报actdate 无法辨识

应该算是2005 的改进吧 ,但不知2者有什么区别
...全文
95 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
yesyesyes 2008-06-06
  • 打赏
  • 举报
回复
试试
order by convert(char(10), actdate, 111) desc
wangdehao 2008-06-06
  • 打赏
  • 举报
回复
order by actdate desc
---应该是它的问题
kuangtu007 2008-06-06
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 zkchenpeng 的回复:]
区别是2005比2000版本高
[/Quote]


------------
真聪明,我怎么没想到
zkchenpeng 2008-06-06
  • 打赏
  • 举报
回复
区别是2005比2000版本高
kuangtu007 2008-06-06
  • 打赏
  • 举报
回复
select convert(char(10), actdate, 111) actdate, * from YDBDLIST where sc#='B86055600' and item='1'
and substring(convert(char(10), actdate, 111),6,2) = right('00'+ltrim(str(MONTH('20080606'))), 2 )
and status<>'D1' and p_flag<>'C' order by actdate desc
-狙击手- 2008-06-06
  • 打赏
  • 举报
回复
别名不能取存在的列名?
中国风 2008-06-06
  • 打赏
  • 举报
回复
查看一下執行計劃和步驟..
中国风 2008-06-06
  • 打赏
  • 举报
回复
..
utpcb 2008-06-06
  • 打赏
  • 举报
回复
hah
kuangtu007 2008-06-06
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 yesyesyes 的回复:]
试试
order by convert(char(10), actdate, 111) desc
[/Quote]

------------------
这个当然是没问题的

34,587

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧