Peoplesoft sub-query of a sub-query.



AIX 5.3 IDS 9.40.FC5
How can this be re-written to eliminate the subquery?
I can't seem to get MAX to work with the outer join on ()

select x0.setid ,x0.cust_id ,x0.name1 ,x0.roleuser ,
sum(x1.bal_amt) ,x2.cr_limit ,x2.cr_limit_rev_dt ,x2.cr_limit_range ,
x2.credit_class ,x0.currency_cd
from "sysadm".ps_customer x0 ,"sysadm".ps_cust_data
x1 ,"sysadm".ps_cust_credit x2 where ((((((((x0.cust_status
= 'A' ) AND (x0.bill_to_flg = 'Y' ) ) AND (x0.cust_level !=
'P' ) ) AND (x0.setid =
(select x3.setid from
"sysadm".ps_set_cntrl_rec
x3 where ((x3.setcntrlvalue = x1.business_unit ) AND (x3.recname
= 'CUSTOMER' ) ) ) ) ) AND (x0.cust_id = x1.cust_id ) ) AND
(x2.setid = x0.setid ) ) AND (x1.cust_id = x2.cust_id ) )
AND (x2.effdt =
(select max(x4.effdt ) from "sysadm".ps_cust_credit
x4 where ((((x4.setid = x2.setid ) AND (x4.cust_id = x2.cust_id
) ) AND (x4.effdt <= TODAY ) ) AND (x4.eff_status = 'A' )
) ) ) )

group by x0.setid ,x0.cust_id ,x0.name1 ,x0.roleuser
,x2.cr_limit ,x2.cr_limit_rev_dt ,x2.cr_limit_range ,x2.credit_class
,x0.currency_cd ;

.



Relevant Pages

  • Re: Moving/Migrating /etc files from AIX 4.3.3 to AIX 5.3.0
    ... Also just set the root and other passwords to what you want them to be when they get to 5.3 on the 4.3 system and then ftp those files. ... Moving/Migrating /etc files from AIX 4.3.3 to AIX 5.3.0 ... When comparing the base 'passwd', 'group', etc., I've noticed ... have ids which are assigned to different users than the ids on ...
    (AIX-L)
  • RE: Assert Failure
    ... I saw this on IDS10FC3 on AIX 5.3 occasionally also. ... timestamp: 0x11ec9e. ... 02:43:14 Action: Please notify IBM Informix Technical Support. ... Which version of IDS 10? ...
    (comp.databases.informix)
  • RE: ONCONFIG and AIX
    ... Subject: ONCONFIG and AIX ... We are currently on IDS 10.FC4 on HP-UX 11 ... Here is my ONCONFIG - thanks! ... number of KAIO control blocks that can be allocated, ...
    (comp.databases.informix)
  • Re: Can I limit the number or records to return given a condition?
    ... But, the problem is that, some IDs in T2 has multiple records, and as a ... single-row subquery returns more than one row ... found some offending IDs from T2. ... 'rownum' is NOT the first row ...
    (comp.databases.oracle.server)
  • Re: ids 10 datetime migrate error
    ... aix 4.3 ... ids: 10.00.FC3R1 server name: on17tcp ...
    (comp.databases.informix)