Iverson_MVP_3 2015-04-20 06:11 采纳率: 37.5%
浏览 1506
已采纳

求SQL神帮忙解决问题,谢谢

表test
id store

1 33

2 55

3 66

4 88

5 12

查询或的结果
id store store1 store2
1 33 33 33
2 55 88 121
3 66 154 275
4 88 242 517
5 12 254 771

求SQL语句

  • 写回答

5条回答 默认 最新

  • 乱舞殇 2015-04-20 07:58
    关注
     select id,store,store1,(select SUM(store1) from (select id,store,(select SUM(store) from t_test b where b.ID<=a.ID ) store1 from t_test a) copyt where copyt.ID<=thist.ID) store2 from (select id,store,(select SUM(store) from t_test b where b.ID<=a.ID ) store1 from t_test a) thist
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法