This query seems to go into an infinite loop. It runs for hours but never completes. The sub query runs in a few milliseconds when is not a sub query.

 

Is this a bug or have I missed something fundamental.

 

SELECT BFNAME FROM BFTABLE

WHERE BFNUMBER IN

(              SELECT BFNUMBER

                FROM BFDETAILTABLE

                GROUP BY BFNUMBER

                HAVING COUNT(*) > 1

)

 

 

Thanks