Use the following query to get records behind not only the page but sub-pages on a page.
WITH my_data AS
(SELECT subpnlname
FROM pspnlfield
WHERE pnlname = :1AND subpnlname <>''
GROUPBY subpnlname)
SELECT recname
FROM pspnlfield, my_data
WHERE pnlname = :1OR pnlname = my_data.subpnlname
GROUPBY recname;
(SELECT subpnlname
FROM pspnlfield
WHERE pnlname = :1AND subpnlname <>''
GROUPBY subpnlname)
SELECT recname
FROM pspnlfield, my_data
WHERE pnlname = :1OR pnlname = my_data.subpnlname
GROUPBY recname;
Same query as above but written differently (suggested by a colleague of mine):
SELECT recname
FROM pspnlfield a
WHERE pnlname = :1
OREXISTS(
SELECT'x'
FROM pspnlfield a
WHERE pnlname = :1
OREXISTS(
SELECT'x'