|
I understood the problem but your fix could have problem: create table foo(
bar number(3) not null,
baz varchar2(50)
);
insert into foo( 1, '0abc');
insert into foo( 10, 'abc');
select count(distinct bar || baz) from foo;
// this will return 1 because '||' will concat the 2 columns and won't apply a real distinct
If we want something independent of the DBMS, we must use a request like: SELECT COUNT(*) FROM (SELECT DISTINCT column1, column2, column3 FROM table_name) Note: Problem also occurs with DB2 I'd prefer to avoid subqueries if possible because they're a lot slower than regular queries. Wouldn't a GROUP BY on the multiple columns provide the same result? SELECT COUNT(DISTINCT column1, column2, column3) FROM table_name would become SELECT COUNT(*) FROM table_name GROUP BY column1, column2, column3 Feel free to slap me if I'm saying stupid things atm... I need more coffee! No, this wouldn't function Hehe, coffee taken ; ) This thread: http://www.dbasupport.com/forums/showthread.php?t=11349 This isn't a blocking issue, so I'm lowering priority to critical. An alternative exists: passing a query to setRowCount(). Resolved in r16149 and merged to release-1.8 in r16150 |
||||||||||||||||||||||||||||||||||||||
Please, could you provide a complete reproduce code?