返回2004-10 月分以来的所有帖子 ,怎么写SQL 语句??

yuna4001 2005-03-26 01:58:36
返回2004-10 月分以来的所有帖子 ,怎么写SQL 语句??
...全文
82 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Well 2005-03-26
  • 打赏
  • 举报
回复
select * from tablename where (cast(year(Datatime) as varchar)+
+'-'+cast(month(Datatime) as varchar))='2004-10'
lxd99423 2005-03-26
  • 打赏
  • 举报
回复
select * from tablename where convert(char(7),datecol,120>='2004-10-01'
paoluo 2005-03-26
  • 打赏
  • 举报
回复
这样也可以

Select * from 表 Where Convert(varchar(7),字段,120)>='2004-10'
xluzhong 2005-03-26
  • 打赏
  • 举报
回复
select * from tablename where datediff(m,datecol,'2004-10-1')<=0
paoluo 2005-03-26
  • 打赏
  • 举报
回复
Select * from 表 Where DateDiff(d,'2004-10-01',字段)>0
hsj20041004 2005-03-26
  • 打赏
  • 举报
回复


select * from tablename where convert(char(7),datecol,120)<='2004-10'
xluzhong 2005-03-26
  • 打赏
  • 举报
回复
select * from tablename where convert(char(7),datecol,120)='2004-10'

34,873

社区成员

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

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