I did
create table tmp select min(xxx_id) from xxx group by y having count(*)>1;
now I need to join this tmp table with another table, but how do I reference the only column in side the tmp table?
select * from table2 s, tmp t where s.xxx_id=t.xxx_id?
clearly won’t work, what should be replacing t.xxx_id?
You need to enclose that column in quotes as:
but it’s always better to give alias to columns as it’s not confusing: