Вопрос

My Sql query is

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

Where OneWayNetTransactionRes is a view.

CREATE VIEW `OneWayNetTransactionRes` AS
SELECT frm_id, to_id, sum(amount) total_amount
FROM TransactionResolution
GROUP BY frm_id, to_id

Yet I get the error

1066: Not unique table/alias: 'b'
Это было полезно?

Решение

Use a . instead of ,:

ON a.frm_id = b.to_id

instead of

ON a,frm_id = b.to_id
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top