Home Forums SQL Server 2008 T-SQL (SS2K8) GROUP BY question RE: GROUP BY question
brad.mason5
Hall of Fame
Points: 3299
More actions
May 7, 2013 at 7:42 pm
#1613187
SELECT DISTINCT
ID =lot.value
, SiteID = DENSE_RANK()OVER(ORDER BY Country DESC)
,Country
FROM SiteMatches
CROSS APPLY (
VALUES('RetainedRID', RetainedRID)
, ('DroppedRID', DroppedRidd )) Lot(name,value)