Skip to Main Content

Integration

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

SELECT COUNT DISTINCT

366274Nov 6 2002
Using TL4.0.2, I have a scenario where we are using a cursored stream with a SQL statment that includes a DISTINCT. In this scenario, the stream.size() generates a select that does not do a DISTINCT count causing the wrong number of rows to be returned.

I have attempted to work around this by using a ReportQuery instead of the stream.size(), but am having difficulty generating a statement like "select (DISTINCT column(s)) from table". There are two issues:

1. Specifying reportQuery.useDistinct() generates "select DISTINCT count(*) from ..." rather than "select count(DISTINCT column(s)) from ...".

2. I need to get the DISTINCT to apply to multiple columns versus just one column.

Any ideas on how to handle this scenario?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 4 2002
Added on Nov 6 2002
2 comments
1,842 views