tsql goup by clause in merge statement

Solutions on MaxInterview for tsql goup by clause in merge statement by the best coders in the world

showing results for - "tsql goup by clause in merge statement"
Kaitlin
01 Sep 2016
1MERGE dbo.MyTarget targ
2USING (SELECT ... FROM dbo.MySource GROUP BY .....) src
3ON (targ.Identifier = src.Identifier
4    AND targ.Name = src.ConstituentName
5    AND targ.Ticker = src.ConstituentTicker
6    AND (targ.CUSIP = src.CUSIP OR targ.ISIN = src.ISIN OR targ.SEDOL = src.SEDOL))
7WHEN MATCHED THEN
8-- update values
9;