Considering this simple example:
INSERT INTO TemporaryTable
SELECT RealTable.name as name
FROM RealTable
LIMIT 1
I'm creating a temporary table from a SELECT.
Problem: the temporary table's field size are set to the SELECT's result set's max length of each field. For instance, if the result set contains something like: name = "John Doe", the "name" field in the temporary table will be VARCHAR(8) because the length of "John Doe" is 8 even if RealTable.name is a varchar(255)
I want the TempoarayTable.name's length to be the same as the name from the real table. Is there a way to do it automatically? Thank you.
Do a