Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: ORA-00904 Invalid column name for SELECT COUNT(DISTINCT ...) with Oracle 9i and ADO

Re: ORA-00904 Invalid column name for SELECT COUNT(DISTINCT ...) with Oracle 9i and ADO

From: Jusung Yang <JusungYang_at_yahoo.com>
Date: 13 May 2003 07:17:39 -0700
Message-ID: <130ba93a.0305130617.4a977737@posting.google.com>


"Phil Jollans" <nospam_at_messring.de> wrote in message news:<b9qf57$kbblq$1_at_ID-178233.news.dfncis.de>...
> Our application uses a select statement in the form
> SELECT COUNT ( DISTINCT <column> ) FROM <table>
> on an Oracle database.
>
> We are accessing the database using ADO and the Oracle OLEDB driver OraOledb
> (not MsdaOra).
>
> This query works fine with the Oracle 8.1.7 client software, but returns an
> error with the Oracle 9i client software. It does not appear to matter
> whether the server is 8i or 9i.
>
> The query works fine from SQL-Plus Worksheet, but fails in our application.
> It also fails using a simple ADO based query tool (QTADO) using the oledb
> provider OraOledb.
>
> The error is Invalid Column Name ORA-00904.
>
> The error does not occur with SELECT COUNT, or with SELECT DISTINCT, but
> always occurs when they are combined.
>
> Any help would be appreciated,
>
> Phil

Just a guess. Did you try using an alias? Like Select count(distinct column_name) header from ....

where header is the alias.

Received on Tue May 13 2003 - 09:17:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US