Counting unique values SQL

ppataki

Registered User.
Local time
Today, 11:31
Joined
Sep 5, 2008
Messages
267
Dear All,

I have a query that should count unique values only but it does not work:

SELECT Count(*) AS Expr1
FROM [SELECT DISTINCT T1.[field1] FROM [table1] AS T1]. AS T1;

if I replace field1 and table1 with my table and field I get an
invalid bracketing error message

Could you please advise?
Many thanks ;)
 
SELECT Count(*) AS Expr1
FROM (SELECT DISTINCT T1.[field1] FROM [table1] AS T1) AS T1;

Brian
 
Thank you very much it works fine!! :)
 

Users who are viewing this thread

Back
Top Bottom