- 先更新下述資料表:
- tbl_GridCumulativeDailyRainfall
- tbl_GridBoundaryRainfallRealTime
- tbl_GridCumulativeDailyRainfallRaw
-- 更新 tbl_GridCumulativeDailyRainfall
select DataTime, X1, Y1, DataValue, HourTime into tbl_GridCumulativeDailyRainfall_0408 from tbl_GridCumulativeDailyRainfall where DataTime >='2024-03-19'
insert into tbl_GridCumulativeDailyRainfall(DataTime, X1, Y1, DataValue, HourTime)
select DataTime, X1, Y1, DataValue, HourTime from tmp_tbl_GridCumulativeDailyRainfall_0408 where DataTime >='2024-03-19'
-- 更新 tbl_GridBoundaryRainfallRealTime
select Id, BoundaryID, BoundaryType, DataTime, Rain into tbl_GridBoundaryRainfallRealTime_0408 from tbl_GridBoundaryRainfallRealTime where DataTime >='2024-03-19' order by DataTime desc
insert into tbl_GridBoundaryRainfallRealTime(BoundaryID, BoundaryType, DataTime, Rain)
select BoundaryID, BoundaryType, DataTime, Rain from tmp_tbl_GridBoundaryRainfallRealTime_0408 where DataTime >='2024-03-19' order by DataTime desc
-- 更新 tbl_GridBoundaryRainfallRealTime
select DataTime, RawData into tbl_GridCumulativeDailyRainfallRaw_0408 from tbl_GridCumulativeDailyRainfallRaw where DataTime >='2024-03-19'
insert into tbl_GridCumulativeDailyRainfallRaw(DataTime, RawData)
select DataTime, RawData from tmp_tbl_GridCumulativeDailyRainfallRaw_0408 where DataTime >='2024-03-19'
- 更新排程程式