Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TEMPORARY table in SELECT 1

Status
Not open for further replies.

bobo123

Programmer
Oct 4, 2002
30
I have problems with using temporary table in SELECTs, where is tmptable JOINed more then once.
F.e.:
CREATE TEMPORARY table tmptbl SELECT * from basetable
Next is O.K.:
select * from table1
left join tmptbl tmp1 on table1.a1=tmp1.a
order by ...
Next gives me an error:
select * from table1
left join tmptbl tmp1 on table1.a1=tmp1.a
left join tmptbl tmp2 on table1.a2=tmp2.a
order by ...

With standard (non temporary table) are BOTH examples OK.

Please any experience, contribution ??
Thanks a lot
Nikos
nikosx@email.cz
 
well, this won't work m8

from the mysql documentation:

Known Errors and Design Deficiencies in MySQL (
You can't use temporary tables more than once in the same query. For example, the following doesn't work:
mysql> SELECT * FROM temporary_table, temporary_table AS t2;
 
Thanks a lot,
that's what I was looking for !
Bobo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top