DISTINCT not working



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
.



Relevant Pages

  • Re: duplicates query help & strategy for update queries with SetWarnings = False
    ... I'm calling a function that will set the occurence number. ... If there's a duplicate, ... I used the query wizard to create a "find duplicates" query, now I need to adjust the results of that query to add an occurence counter/number, and I'd be set. ... Once the user has handled all the problems, you enable the final command button at the bottom of the form, which executes an append query to add the data to the real table. ...
    (comp.databases.ms-access)
  • Re: Identifying Duplicate Records
    ... Indeed, the duplicate records ... Discovering the Find Duplicate query, ... or bring up the dupe records to look at them. ... have a find duplicate records wizard. ...
    (microsoft.public.access.formscoding)
  • Re: Identifying Duplicate Records
    ... the duplicate records problem represented one of the few occasions ... the Find Duplicate query, however, has allowed me to plug another gap in my ... or bring up the dupe records to look at them. ...
    (microsoft.public.access.formscoding)
  • Re: duplicates query help & strategy for update queries with SetWarnings = False
    ... After playing around with duplicates, and a funtion to generate an occurence number, it looked like you would need a handful of queries per table!! ... Once the user has handled all the problems, you enable the final command button at the bottom of the form, which executes an append query to add the data to the real table. ... On a "Find Duplicates Query", does anyone have a good solution for renaming the duplicate records? ...
    (comp.databases.ms-access)
  • Re: duplicates query help & strategy for update queries with SetWarnings = False
    ... If there's a duplicate, ... I used the query wizard to create a "find duplicates" query, now I need to adjust the results of that query to add an occurence counter/number, and I'd be set. ... I have many many queries that check for orpaned data (for example, if there's a billing record with no matching custID in the customer table, I'm putting up a form with the unmatched data, and a quick way to update all unmatched to one archive type customer, etc. ... Once the user has handled all the problems, you enable the final command button at the bottom of the form, which executes an append query to add the data to the real table. ...
    (comp.databases.ms-access)

Loading