mysql sub-select work around?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Mike Starke
Date:  
Subject: mysql sub-select work around?
On Wed, Feb 05, 2003 at 09:18:59AM -0700, 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