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?


On 2/27/08 12:34 PM, "Bharath Booshan L" <[EMAIL PROTECTED]>
wrote:

> 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 which an entry has been recorded in
> my table?
> 
> The answer I am expecting is 4 ( i.e. A,B,C,E)
> 
> Using query "select count(DISTINCT Name) from TableA" results in an error.
> 
> Could anyone please post a SQL query for my problem?
> 
> Thanks in advance,
> 
> Bharath 
> 
> 
> 
> -----------------------------------------------
> 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
> 



-----------------------------------------------
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

Reply via email to