我想用一条sql语句查出表tb1 的num,qty,per和当表tb2的num(号数)等于表tb1的num(号数)的money总数
我这样写select a.num,a.qty,a.per,sum(b.money) from tb1 a , tb2 b where b.num = a.num
但是提示语法有错误,请问该怎么写?请大家帮帮忙!
...全文
585打赏收藏
嵌套查询
表tb1 有字段num,qty,per 表tb2 有字段num,money 我想用一条sql语句查出表tb1 的num,qty,per和当表tb2的num(号数)等于表tb1的num(号数)的money总数 我这样写select a.num,a.qty,a.per,sum(b.money) from tb1 a , tb2 b where b.num = a.num 但是提示语法有错误,请问该怎么写?请大家帮帮忙!