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!

Query not returing the Data

Oracle userMar 12 2013 — edited Mar 13 2013
All / Experts,

Can we use a.invoices in the IN clause of the below query:

select a.user_id, count(*) Download
from (
select '''' || to_char(replace ( substr(details, 26 , instr( details , '<' , 1,3)-26 ) , ',', ''',''' ) || '''') as invoices , actinguserid as user_id
from bchistevent where bucket = 201301
and upper(type) = 'COM.AVOLENT.PRESENTATION.EVENT.INVOICEDOWNLOADEVENT'
--and bchistevent.bucket = to_char (add_months (sysdate, -1),'YYYYMM')
) a,
bcbillsumm b
where b.stmtnum in (a.invoices)
group by a.user_id;

I am not getting the result.

However, by placing the values such as '395452997-000-20130103' in the IN clause is working fine.
Any help here will be appreciated.

Regards
Oracle User
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 10 2013
Added on Mar 12 2013
10 comments
97 views