SELECT orderid, COUNT(*) TotalCount FROM masterorder GROUP BY orderid HAVING COUNT(*) > 1