Tip - Always use aliases in your sql and qualify all columns with the alias, even if you think the column name is unambiguous. It helps reading and understanding a query without having all the table definitions and avoids confusion - both for the human reader, and at times for Oracle. I presume that cl_clcode is from client, as_clcode from assets_view, and pc_clcode from perfclient. Try completing the transitive closure and add the predicate "AND pc_clcode = as_clcode" and see if that helps. At 03:06 PM 6/21/2004, you wrote: > > Hi all, > > I have the following query which is running very slow as it takes few min= >utes to complete. > >=20 > > SELECT sum(nvl(as_ofcsh,0)),sum(nvl(as_offxd,0)), > > sum(nvl(as_ofeqty,0)),sum(nvl(as_ofai,0)) > > FROM perfclient, assets_view, client > > WHERE cl_decmkr=3D'64501013' > > AND cl_clcode=3Das_clcode > > AND as_date=3D '200312' > > AND cl_clcode=3Dpc_clcode > > AND pc_prfcomb in ('B', 'Y') > > AND pc_grpdte !=3D '0000-00-00' > > AND substr(pc_grpdte,1,4)||substr(pc_grpdte,6,2) <=3D '200312' > >=20 regards Wolfgang Breitling Centrex Consulting Corporation www.centrexcc.com ---------------------------------------------------------------- Please see the official ORACLE-L FAQ: http://www.orafaq.com ---------------------------------------------------------------- To unsubscribe send email to: oracle-l-request@xxxxxxxxxxxxx put 'unsubscribe' in the subject line. -- Archives are at //www.freelists.org/archives/oracle-l/ FAQ is at //www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------