这样的SQL语句怎么写??

fdlqcc 2003-08-19 08:48:37
数据库中有表table1
startdate enddate num
2003-07-29 2003-08-10 200.0
2003-08-11 2003-08-20 100.0
2003-08-21 2003-08-28 150.0
2003-07-21 2003-07-28 130.0
求一SQL语句可得到2003-7-29(startdate)到2003-8-28(enddate)的num之和,谢谢大家
...全文
45 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
hjb111 2003-08-19
  • 打赏
  • 举报
回复
select sum(num) from yourtable where startdate>'2003-7-29' and enddate<='2003-8-28'
z5wjz 2003-08-19
  • 打赏
  • 举报
回复
Select sum(num) from table1 where startdate >= '2003-7-29' and enddate <= '2003-8-28'
pengdali 2003-08-19
  • 打赏
  • 举报
回复
Select sum(num) 和 from 表 where startdate>='2003-7-29' and enddate<= '2003-8-28'
txlicenhe 2003-08-19
  • 打赏
  • 举报
回复
Select sum(num) from table1
where startdate >= '2003-7-29' and enddate <= '2003-8-28'

22,207

社区成员

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

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