我的Sql查询是
Select a.sum_total FROM
OneWayNetTransactionRes a
LEFT OUTER JOIN
OneWayNetTransactionRes b
ON
a,frm_id = b.to_id
AND a.to_id = b.frm_id
OneWayNetTransactionRes
是视图。
CREATE VIEW `OneWayNetTransactionRes` AS
SELECT frm_id, to_id, sum(amount) total_amount
FROM TransactionResolution
GROUP BY frm_id, to_id
然而我收到了错误
1066: Not unique table/alias: 'b'
答案 0 :(得分:2)
使用.
代替,
:
ON a.frm_id = b.to_id
而不是
ON a,frm_id = b.to_id