Quantcast
Channel: Lepa's blog
Viewing all articles
Browse latest Browse all 20

Identify Records Behind a Page and Subpage

$
0
0

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;

Same query as above but written differently (suggested by a colleague of mine):
SELECT  recname
    FROM pspnlfield a
   WHERE pnlname = :1
      OREXISTS(
            SELECT'x'

read more


Viewing all articles
Browse latest Browse all 20

Trending Articles