sql query for finding records where count > 1