码迷,mamicode.com
首页 > 数据库 > 详细

sql 表数据转移另一张表

时间:2018-10-12 14:12:33      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:isl   color   ali   sys   sele   mis   state   pass   object_id   

 

 if not exists(select * from syscolumns where id=object_id(‘REMOTEDETECTION_2018‘)) 
begin SELECT * INTO  REMOTEDETECTION_2018  FROM REMOTEDETECTION  where 1=0  end;
 
 

insert into RemoteDetections(DETECTIONSTATE,PASSDATETIME,VLPN,VLPNCOLOR,FUELTYPE,BZTYPE,VEHICLETYPE,RECENTSTATION,CO,CO2,NO,HC,VSP,SPEED,ACCELERATION,CONFIDENCE,WINDSPEED,WINDDIRECTION,
TEMPERATURE,IMPORTDATE,IUVTYPE,OWNERNAME,City_ID,Station_ID,REMOTEDETECTIONCODE,NH3,SF,IMAGEPATH,IMAGE,humidity,atmosphere,Highemissions,IsValid,Islocal,StationCode,CarColor,CarType,
Image1Name,Image1Path,Image2Name,Image2Path,VideoName,VideoPath,VehicleID)


select DETECTIONSTATE,PASSDATETIME,VLPN,VLPNCOLOR,FUELTYPE,BZTYPE,VEHICLETYPE,RECENTSTATION,CO,CO2,NO,HC,VSP,SPEED,ACCELERATION,CONFIDENCE,WINDSPEED,WINDDIRECTION,
TEMPERATURE,IMPORTDATE,IUVTYPE,OWNERNAME,City_ID,Station_ID,REMOTEDETECTIONCODE,NH3,SF,IMAGEPATH,IMAGE,humidity,atmosphere,Highemissions,IsValid,Islocal,StationCode,CarColor,CarType,
Image1Name,Image1Path,Image2Name,Image2Path,VideoName,VideoPath,VehicleID from RemoteDetection where PASSDATETIME>=‘2018-10-08 00:00:00‘ and PASSDATETIME<=‘2018-10-08 23:59:59‘;

 

sql 表数据转移另一张表

标签:isl   color   ali   sys   sele   mis   state   pass   object_id   

原文地址:https://www.cnblogs.com/luoguixin/p/9777105.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!