使用Another Table中的选择列创建一个表

时间:2015-01-10 07:34:52

标签: mysql create-table

我试图在新表中分解GPS点,因为旧表在CHAR中,我的新表将设置为INT。

Drop Table LoopTest1;

CREATE TABLE LoopTest1 (
`Account Number`  char(32) NULL ,
`Latitude`  decimal(30,2) NULL ,
`LatDegree`  int(2) NULL ,
`LatMinutes`  int(2) NULL ,
`LatSeconds`  decimal(5,2) NULL ,
`LatDecimal`  decimal(30,6) NULL ,
`Longitude`  decimal(30,2) NULL ,
`LongDegree`  int(2) NULL ,
`LongMinutes`  int(2) NULL ,
`LongSeconds`  decimal(5,2) NULL ,
`LongDecimal`  decimal(30,6) NULL 
);

set 
        LoopTest2.`Account Number` = LoopTest1.`Account Number`,
        LoopTest2.Latitude = LoopTest1.Latitude,
        LoopTest2.Longitude =LoopTest1. Longitude

FROM
        LoopTest2

这只是一个临时表,因为我将使用LoopTest1中的更改​​来更新LoopTest2

0 个答案:

没有答案
相关问题