SELECT COUNT DISTINCT
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?