Search Postgresql Archives

Subselects - recursion problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



People,

The following script works (I have confirmed it by doing two separate
views and doing a select on them) - but I don't understand why there
isn't a recursion problem with c1.policy and c2.policy - is there some
sort of trick happening?

Thanks,

Phil.


SELECT c1.loc, c1.lob, c1.policy
FROM crec
AS c1
WHERE c1.t_type = '1'
AND c1.t_diss = '2'
AND c1.recon = 'Y'
AND c1.policy = (   SELECT c2.policy
                    FROM crec
                    AS c2
                    WHERE c2.t_type = '1'
                    AND c2.t_diss = '0'
                    AND c2.recon = 'N'
                    AND c1.loc = c2.loc
                    AND c1.lob = c2.lob
                    AND c1.policy = c2.policy )
ORDER BY c1.loc, c1.lob, c1.policy ;



-- 
Philip Rhoades

Pricom Pty Limited  (ACN 003 252 275  ABN 91 003 252 275)
GPO Box 3411
Sydney NSW      2001
Australia
Mobile:  +61:0411-185-652
Fax:  +61:2:8923-5363
E-mail:  phil@xxxxxxxxxx



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux