I have two complex subqueries that I need to join. I suspect this
problem is due to using aliases instead of table names, but I don't
know how to work around it (temporary tables?). Please help.
SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2
JOIN t1 ON t2.col = t1.col;
[color=blue][color=green][color=darkred]
>>> Not unique table/alias: 't1'.[/color][/color][/color]
SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2
WHERE t2.col = t1.col;
[color=blue][color=green][color=darkred]
>>> Works fine! (But this query is different, because it doesn't get[/color][/color][/color]
the rows that are NULL in one of the tables.)
Using MySQL 4.1.1. Thanks in advance for your help.
problem is due to using aliases instead of table names, but I don't
know how to work around it (temporary tables?). Please help.
SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2
JOIN t1 ON t2.col = t1.col;
[color=blue][color=green][color=darkred]
>>> Not unique table/alias: 't1'.[/color][/color][/color]
SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2
WHERE t2.col = t1.col;
[color=blue][color=green][color=darkred]
>>> Works fine! (But this query is different, because it doesn't get[/color][/color][/color]
the rows that are NULL in one of the tables.)
Using MySQL 4.1.1. Thanks in advance for your help.
Comment