Hi Bharath,

Works for me in 3.4.2

SQLite version 3.4.2
Enter ".help" for instructions
sqlite> create table tst( nun integer, nm text );
sqlite> insert into tst values( 23, 'A' );
sqlite> insert into tst values( 23, 'b' );
sqlite> insert into tst values( 24, 'C' );
sqlite> insert into tst values( 25, 'A' );
sqlite> insert into tst values( 23, 'E' );
sqlite> select count( distinct nm ) from tst;
4

Rgds,
Simon


On 27/02/2008, Bharath Booshan L <[EMAIL PROTECTED]> wrote:
>
> ------ Forwarded Message
> From: Bharath Booshan L <[EMAIL PROTECTED]>
> Date: Wed, 27 Feb 2008 14:32:14 +0530
> To: Eugene Wee <[EMAIL PROTECTED]>
> Conversation: [sqlite] Query to Find number of distinct records
> Subject: Re: [sqlite] Query to Find number of distinct records
>
> I was off for lunch
>
> > The thing is, it should work. What is the error message?
>
> sqlite> select count(DISTINCT Name) as nameCount from TableA;
> SQL error: near "DISTINCT": syntax error
>
>
> On 2/27/08 1:24 PM, "Eugene Wee" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > Bharath Booshan L wrote:
> >> Yeah!! I got it right this time.
> >>
> >> Select count(*) from ( select DISTINCT Name from TableA);
> >>
> >>
> >> But what's not getting into my mind is the difference b/w the following two
> >> queries:
> >>
> >> Select count( Name) from TableA  -- works fine
> >>
> >> Select count(DISTINCT Name) from TableA -- doesn't work, Any reason?
> >
> > The thing is, it should work. What is the error message?
> >
> > Regards,
> > Eugene Wee
> >
>
> ------ End of Forwarded Message
>
>
>
> -----------------------------------------------
> Robosoft Technologies - Come home to Technology
>
> Disclaimer: This email may contain confidential material. If you were not an 
> intended recipient, please notify the sender and delete all copies. Emails to 
> and from our network may be logged and monitored. This email and its 
> attachments are scanned for virus by our scanners and are believed to be 
> safe. However, no warranty is given that this email is free of malicious 
> content or virus.
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to