If you *have* to do it this way (and you do), using the TEMPORARY TABLE keyword is a little more elegant. You can go home at night feeling a little more �ber. :)
http://dev.mysql.com/doc/mysql/en/create-table.html From MySQL 3.23 on, you can use the |TEMPORARY| keyword when creating a table. A |TEMPORARY| table is visible only to the current connection, and is dropped automatically when the connection is closed. This means that two different connections can use the same temporary table name without conflicting with each other or with an existing non-|TEMPORARY| table of the same name. (The existing table is hidden until the temporary table is dropped.) From MySQL 4.0.2 on, you must have the |CREATE TEMPORARY TABLES| privilege to be able to create temporary tables. Jeromie >DROP TABLE IF EXISTS maxdates; >CREATE TABLE maxdates SELECT name,max(date) AS date FROM customers GROUP >BY name; >SELECT customers.name,customers.date,code FROM customers INNER JOIN >maxdates USING (name,date); >DROP TABLE maxdates; > >Not sure as of which version this is valid. As before it is on my >system with MySQL 4.1.9. > >Rgds, >Carl > > > >The php_mysql group is dedicated to learn more about the PHP/MySQL web >database possibilities through group learning. >Yahoo! Groups Links > > > > > > > > The php_mysql group is dedicated to learn more about the PHP/MySQL web database possibilities through group learning. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php_mysql/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
