I am trying to find rows that have duplicate values, but only based off of a select number of columns, not a single column or the entire row. For example, if my table looked
Try the following:
SELECT A.*
FROM YourTable A
INNER JOIN (SELECT Address, State
FROM YourTable
GROUP BY Address, State
HAVING COUNT(*) > 1) B
ON A.Address = B.Address AND A.State = B.State
select *
from #table1
where Addr + St in (select Addr + St as FullAddr
from #table1
group by Addr + St
having count(Addr+St) > 1)