0

我的 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'
4

1 回答 1

2

使用 a.代替,

ON a.frm_id = b.to_id

代替

ON a,frm_id = b.to_id
于 2012-06-03T15:17:34.173 回答