-1
**
**if (month(getdate())=01) and (day(getdate())=01)
declare @i as datetime
declare @j as datetime
set @i = getdate()
set @j=select year(@i)-3
---set @[email protected]
---set @i
select '@j'+''+'dec'+''+'31'
select distinct * into <destination> from <source> where <datecolumn><= '@j'+'-'+'dec'+'-'+'31'**
這是我已經高達現在完成了,但事情是我需要將數據從當前追加到歷史,每今年
爲什麼不直接插入 SELECT DISTINCT * FROM