Hi,
I have a table with 3 DOUBLE fields: "x", "y" and "f".
From this table I'm creating a new one using the query
"CREATE TABLE new TABLE
SELECT ROUND((x-21.45)/5) AS newx,
ROUND((y-18.15)/5) AS newy,
f AS newf FROM oldtable;"
This creates a new table with these 3 fields:
newx DOUBLE(25,0)
newy DOUBLE(25,0)
newf DOUBLE
My question is: how can I alter this query to create a table with the fields:
newx INT
newy INT
newf DOUBLE
Thanks a lot
PS: I know I can create the desired table with a query and then insert the records from a select query, but I'd like to do it in a single query, since I do this on a LOT of tables.
I have a table with 3 DOUBLE fields: "x", "y" and "f".
From this table I'm creating a new one using the query
"CREATE TABLE new TABLE
SELECT ROUND((x-21.45)/5) AS newx,
ROUND((y-18.15)/5) AS newy,
f AS newf FROM oldtable;"
This creates a new table with these 3 fields:
newx DOUBLE(25,0)
newy DOUBLE(25,0)
newf DOUBLE
My question is: how can I alter this query to create a table with the fields:
newx INT
newy INT
newf DOUBLE
Thanks a lot
PS: I know I can create the desired table with a query and then insert the records from a select query, but I'd like to do it in a single query, since I do this on a LOT of tables.