sql语句的应用

ZJ_lover 2010-05-27 09:26:50
我要查询我的文章表 article中最近 一个月 !!!的总数,发表日期字段为Arttime

select count(*) from article where 语句怎么写呢?
...全文
58 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
ZJ_lover 2010-05-27
  • 打赏
  • 举报
回复
????
Mr_Nice 2010-05-27
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 pt1314917 的回复:]

mysql语法不清楚
[/Quote]

up
建议去其他数据库开发版问问
--小F-- 2010-05-27
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 zj_lover 的回复:]
引用 6 楼 pt1314917 的回复:
mysql语法不清楚

怎么解决啊 ?
[/Quote]

建议去其他数据库开发版问问
ZJ_lover 2010-05-27
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 pt1314917 的回复:]
mysql语法不清楚
[/Quote]
怎么解决啊 ?
pt1314917 2010-05-27
  • 打赏
  • 举报
回复
mysql语法不清楚
ZJ_lover 2010-05-27
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 pt1314917 的回复:]
SQL code

--or:
select count(*) from article where Arttime>=dateadd(mm,-1,getdate())
[/Quote]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*) from article where Arttime>=dateadd(mm,-1,getdate())' at line 1
ZJ_lover 2010-05-27
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 xys_777 的回复:]
select count(*) from article where Arttime>=dateadd(m,-1,getdate())
[/Quote]
我试了 不行啊
pt1314917 2010-05-27
  • 打赏
  • 举报
回复

--or:
select count(*) from article where Arttime>=dateadd(mm,-1,getdate())
pt1314917 2010-05-27
  • 打赏
  • 举报
回复

select count(*) from article
where datediff(dd,Arttime,getdate())<=30
永生天地 2010-05-27
  • 打赏
  • 举报
回复
select count(*) from article where Arttime>=dateadd(m,-1,getdate())

22,210

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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