What would be better way to implement such view so that the query doesn't take too long.
select * from table
where ID in (
SELECT ID FROM table
GROUP BY ID
HAVING COUNT(ID) > 1
)
Our server will need to run this every 10 mins. I thought of Indexing ID but wasn't sure if that would be the right way to go.
JOINperforms better as it is explained below. I wanted to add that you definitively need an index onID.