|
Home > Archive > SQL Server JDBC > May 2005 > DISTINCT not working
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
DISTINCT not working
|
|
| Gonçalo 2005-04-27, 11:23 am |
| I'm using the last version of JDBC driver, and the following query is
returning duplicate values:
SELECT DISTINCT COMPANY_ID C1 FROM COMPANY_WORKERS
By if i make de following query, it works:
SELECT A.C1 FROM (SELECT DISTINCT COMPANY_ID C1 FROM COMPANY_WORKERS ) A
Both queries work ok in the SQL Analyzer, but in the code only the second
one works as espected.
Thanks
Gonçalo
| |
| Sue Purkis 2005-05-03, 11:23 am |
| Gonçalo,
I ran a quick test with the MS driver using SELECT DISTINCT and it worked.
Can you post the code that you are using? Perhaps there is something else
that is happening.
Thanks.
SuePurkis
DataDirect Technologies
"Gonçalo" <Gonalo@discussions.microsoft.com> wrote in message
news:B3FCD484-53E7-42E3-AD22- 26236C9F3927@microso
ft.com...
> I'm using the last version of JDBC driver, and the following query is
> returning duplicate values:
> SELECT DISTINCT COMPANY_ID C1 FROM COMPANY_WORKERS
>
> By if i make de following query, it works:
> SELECT A.C1 FROM (SELECT DISTINCT COMPANY_ID C1 FROM COMPANY_WORKERS ) A
>
> Both queries work ok in the SQL Analyzer, but in the code only the second
> one works as espected.
>
> Thanks
> Gonçalo
|
|
|
|
|