有3张表,A与B是主子表,通过partcode相连接,C表通过cgid与B表左连接,可是A表怎么办呢?
例如:
A表
aid     partcode        status1        001             702        002             103        003             50 B表bid    partcode         cgid         price1      001              b001         2.22      002              b002         3.03      003              b003         1.0
C表cid     cgid          qty    1       b001          202       b002          10
 
3       b003          304       b004          40 想实现的结果为cgid        price*qtyb001        44(因为status='70')b002        0 (因为status != '70')b003        0 (因为status != '70')b004        0 (因为B表里没有相对应的数据)