want to create a temporary table that has an auto_increment field plus a field that has to be select from another table.
Here is what I have (does not work)
CREATE TEMPORARY TABLE tmp (id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
(SELECT valueName AS valueName
FROM sometable
WHERE sometable.somevalue='00'));
these work by them selves but can get the right syntax to do both
CREATE TEMPORARY TABLE tmp (id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
CREATE TEMPORARY TABLE tmp AS SELECT valueName AS valueName FROM sometable
WHERE sometable.somevalue='00';
Relevant docs here: http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-select-into-table.html