Re: [sqlite] Query to Find number of distinct records

2008-02-27 Thread Eugene Wee
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(DISTIN

Re: [sqlite] Query to Find number of distinct records

2008-02-26 Thread Eugene Wee
Hi, What is the error? It seems to me that both of these should work: select count(DISTINCT Name) from TableA select count(DISTINCT Name) as nameCount from TableA Regards, Eugene Wee Bharath Booshan L wrote: > Thanks for your quick response, > >> select count(DISTINCT Name) nameCount from Tab

Re: [sqlite] Query to Find number of distinct records

2008-02-26 Thread Bharath Booshan L
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?

Re: [sqlite] Query to Find number of distinct records

2008-02-26 Thread Bharath Booshan L
ECTED] On Behalf Of Bharath Booshan L > Sent: Wednesday, February 27, 2008 12:35 PM > To: Discussion of SQLite Database > Subject: [sqlite] Query to Find number of distinct records > > Hello All, > > This might be simple question, but am not getting the SQL query right > fo

Re: [sqlite] Query to Find number of distinct records

2008-02-26 Thread Shibu.Narayanan
PROTECTED] On Behalf Of Bharath Booshan L Sent: Wednesday, February 27, 2008 12:35 PM To: Discussion of SQLite Database Subject: [sqlite] Query to Find number of distinct records Hello All, This might be simple question, but am not getting the SQL query right for my problem. For eg, consider

[sqlite] Query to Find number of distinct records

2008-02-26 Thread Bharath Booshan L
Hello All, This might be simple question, but am not getting the SQL query right for my problem. For eg, consider following table NonUniqueNo Name - 23 A 23 B 24 C 25 A 23 E How can I find the number of people for w