【问题标题】:Select sum 3 table different record选择 sum 3 表不同的记录
【发布时间】:2017-04-18 01:44:45
【问题描述】:

我有 3 张桌子

  1. tb_spp
  2. tb_daycare
  3. tb_antarjemput

这是所有三个表的内容:

  1. tb_spp

  1. tb_daycare

  1. tb_antarjemput

我想要这样的出类拔萃

最后的输出是这样的限制 1:

如何掌握?

【问题讨论】:

  • 这是作业吗?
  • 是的,确实如此
  • 请帮帮我。

标签: sql select sum


【解决方案1】:

您可以参考我对选项 1 的查询。

select T1.kode, 
       T1.Nominal_spp, 
       T2.Nominal_antarjemput, 
       (IFNULL(T1.Nominal_spp, 0)*2 + IFNULL(T2.Nominal_antarjemput, 0)) as Total
from tb_spp as T1
left join tb_antarjemput as T2 on T1.kode = T2.kode

【讨论】:

  • #1582 - 调用本机函数 'ISNULL' 时的参数计数不正确
  • 朋友你用的是Sql还是MySQL?
猜你喜欢
  • 2019-05-02
  • 1970-01-01
  • 2017-02-09
  • 2016-10-07
  • 1970-01-01
  • 2015-12-27
  • 2019-03-22
  • 1970-01-01
  • 2022-08-10
相关资源
最近更新 更多