this should do:declare @t1 table (RoadNm varchar(10), Start int, End1 int)insert into @t1select 'Road 1', 0, 500 union allselect 'Road 1', 300, 800 union allselect 'Road 2', 0, 500 union allselect 'Road 2', 500, 800select RoadNmfrom @t1 group by RoadNmhaving sum(end1 - start) != MIN(start) + MAX(end1)
EDIT: fixed a having_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com