Maybe I don't understand the problem, but isn't it just:
Update Declaration_Backup
SET Effective_Start_Date = Updated_date
where Effective_Start_Date IS NULL
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I am using below sql to update Effective_Start_Date as same as updated_date for each source_id.But i am not not able to get it.
Here i have Source_Id having duplicates with different Updated_date
WITH CTE AS (
SELECT *, ROW_NUMBER() OVER (PARTITION BY Source_Id order by Updated_date ) As rn
from Declaration_Backup]
where Effective_Start_Date IS NULL
)
Update CTE
SET Effective_Start_Date = Updated_date
Sample data:
Need to change as below
Please suggest how to chnage sql.
Please suggest how to chnage sql.
Maybe I don't understand the problem, but isn't it just:
Update Declaration_Backup
SET Effective_Start_Date = Updated_date
where Effective_Start_Date IS NULL