Wednesday

delete all duplicates in TSQL but one

     

WITH a as
(
SELECT PeriodId
,StationId
,WeekDay
,WeekCycle
,ProductId
,AssignedDate
,MenuId
,ROW_NUMBER() OVER(PARTITION by PeriodId
                        ,StationId
                        ,WeekDay
                        ,WeekCycle
                        ,ProductId
                        ,AssignedDate
                        ,MenuId ORDER BY PrimawebMenuId desc ) AS duplicateRecCount
FROM MenuProducts
)
--Deleting Duplicate Records
DELETE FROM a
WHERE duplicateRecCount > 1
    

No comments:

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...