Only Return Rows Where Row Count >= 2
Where's the primary key?

DELETE records FROM (
    SELECT 
        ROW_NUMBER() OVER (PARTITION BY HAMBASA, storeid ORDER BY HAMBASA) AS HambasaCount
    FROM @TMI) records
WHERE records.HambasaCount &gt; 1