ok, why dont you run the sql statement alone and see how it performs.
For starters, you seem to be using
Code:
from homesupp a, homemain b where cpolicyno
but you dont seem to be using this reference a or b for the column names in question.