Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ADW vs. CDW query

BugsJul 16 2009 — edited Jul 16 2009
Guys,
Request your guidance.
We've recently migration one of our applications from CDW to ADW.
When I query a SQL in ADW, it gives different result set from that in ADW

CDW Query:
SELECT count(*)
FROM aaa b,
(SELECT DISTINCT cust_id,prod_id
FROM fact
WHERE sales_date >=
(SELECT MAX (TO_DATE (SUBSTR (subpartition_name, 9, 9), 'DDMONYYYY')) - 53 * 7
FROM all_tab_subpartitions
WHERE table_name = 'fact' ) a
WHERE a.cust_id = b.cust_id(+)

ADW query:
SELECT count(*)
FROM aaa b
,(SELECT DISTINCT cust_id,prod_id
FROM fact
WHERE sales_date >=(SELECT TO_DATE(SUBSTR(MAX(partition_name),8),'yyyymmdd') - 53 * 7
FROM all_tab_partitions
WHERE table_name='fact') a
WHERE a.cust_id = b.cust_id(+)

Wierd thing is that the aaa table from both cdw and adw returns the same record count and the inner query as well.
However the whole query as such returns different record count . ie. record count in cdw doesn't match to adw.

Could someone help me out why this happens?

Thanks a ton!!

Regards,
Bhagat
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 13 2009
Added on Jul 16 2009
1 comment
768 views