| http://www.w3.org/ns/prov#value | - This problem is known as Finding Islands", but this case is a special one because there is no other column that we could use to break ties based on (CID, cDate) other than column [Dept].I added one more column, an identity one, to break this tie, and here is the code.SET NOCOUNT ON;USE tempdb;GOCREATE TABLE #tTable(sk int NOT NULL IDENTITY UNIQUE CLUSTERED, CID INT, CDate DATETIME, Dept VARCHAR(1
|