select
   MAINBLOCKTABLE.MAINID as MAINID,
   MIP_GISOBJID as GISOBJID,
   MIP_BLOCKID as BLOCKID
from
   R5MAINISOLATIONMAINS,
   (
      select
         MIP_MAINID as MAINID,
         MIP_GISOBJID as GISOBJID,
         MIP_BLOCKID as BLOCKID
      from
         R5MAINISOLATIONMAINS
      where
         MIP_MAINID = <param.mainid>
   )
   as MAINBLOCKTABLE
where
   R5MAINISOLATIONMAINS.MIP_BLOCKID = MAINBLOCKTABLE.BLOCKID
