mysql sub-select work around?

Mike Starke plug-discuss@lists.plug.phoenix.az.us
Wed, 5 Feb 2003 11:36:54 -0500


On Wed, Feb 05, 2003 at 09:18:59AM -0700, az_pete@cactusfamily.com wrote:
/_Hi Mike,
/_I think this is what you're looking for.
/_
/_
/_drop table if exists tmp_idt;
/_
/_create temporary table tmp_idt
/_SELECT (idt.unit * idt.price) AS Sub_Total
/_FROM idt WHERE idt.myid = "1";
/_
/_select sum(Sub_Total) as 'total' from tmp_idt;
/_
/_
Yes, this works. Could you explain to me how the values
are inserted into the temporary table? All I see is a 'create table'
statement. How is the table populated with values to be able to
issue the second select statement?

Thanks for the solution, now I need to understand how it works :-)_

v/r
-Mike