【Sqlserver】修改数据库表中的数据:对缺失的数据根据已有的数据进行修补


1
--查询时间范围内的数据 2 select * from dbo.point where wtime >'2014-05-01 23:59:59' and wtime< '2014-05-02 00:40:42.000' 3 4 5 delete from point where wtime >'2014-05-01 23:59:59' and wtime< '2014-05-02 00:40:42.000' 6 7 --查询时间范围内的数据,并插入到临时表中 8 select * into a_temp from point where wtime between '2014-05-01 00:00:42.000' and '2014-05-01 00:40:42.000' 9 10 --查询临时表内的数据 11 select * from a_temp 12 13 14 --更新临时表的时间 15 update a_temp set wtime=DATEADD(day,1,wtime) 16 17 --把临时表中的数据插入到表中 18 insert into point select pointid,pointtype,pointvalue,pointunit,pointvalue2,pointunit2,wtime from a_temp

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 &#39;EastRiver&#39; 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...