Following is the query that can be useful to find out all records under a specified component.
SELECT DISTINCT (recname)
FROM psrecdefn
WHERE recname IN
(SELECT DISTINCT (recname)
FROM pspnlfield
WHERE pnlname IN
(SELECT DISTINCT (b.pnlname)
FROM pspnlgroup a, pspnlfield b
WHERE ( a.pnlname = b.pnlname OR a.pnlname =b.subpnlname)
AND a.pnlgrpname = 'Component Name' -- specify your component name)
AND recname <> ' ')
UNION
SELECT DISTINCT (recname)
FROM pspnlfield
WHERE pnlname IN
(SELECT DISTINCT (b.subpnlname)
FROM pspnlgroup a,pspnlfield b
WHERE (a.pnlname = b.pnlname OR a.pnlname = b.subpnlname )
AND a.pnlgrpname = 'Component Name') -- specify your component name)
AND recname <> ' ')
AND rectype = '0' -- specify record type
order by recname asc
Note: 0 is a record type of Sql Table.
2 comments:
Thanks this was useful.
Enje (http://gotecotech.com)
Thanks Pawan. Its a great query.
Post a Comment