我在Mysql中有三个表
我需要为每个uid获取(balance-qty):orderIdcombination用于特定类型的项目。如果表A和表B没有要加入的公共列,如何连接它们。但是它们都连接到表C.
通过3个表之间的连接:
select a.uid, a.balance, b.qty
from tablea a
inner join tablec c on c.uid = a.uid
inner join tableb b on b.orderid = c.orderid
where a.itemtype = ?
如果需要,可以添加更多列。