MySQL temp table issue

Posted by AmyD on Stack Overflow See other posts from Stack Overflow or by AmyD
Published on 2010-06-16T13:43:49Z Indexed on 2010/06/16 13:52 UTC
Read the original article Hit count: 192

Hi folks! I'm trying to use temp tables to speed up my MySQL 4.1.22-standard database and what seems like a simple operation is causing me all kinds of issues. My code is below....

CREATE TEMPORARY TABLE nonDerivativeTransaction_temp (accession_number varchar(30), transactionDateValue date)) TYPE=HEAP;

INSERT INTO nonDerivativeTransaction_temp VALUES( SELECT accession_number, transactionDateValue FROM nonDerivativeTransaction WHERE transactionDateValue = "2010-06-15");

SELECT * FROM nonDerivativeTransaction_temp;

The original table (nonDerivativeTransaction) has two fields, accession_number (varchar(30)) and transactionDateValue (date).

Apparently I am getting an issue with the first two statements but I can't seem to nail down what it is. Any help would be appreciated.

Amy D.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about mysql-query