tags:

views:

334

answers:

2

When I run the query :

select count(*) from 
(select idCover from x90..dimCover group by idCover having count(*) > 1)

I get the error :

Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near ')'

How do I formulate this query correctly?

I'm on SQL Server 2000

+6  A: 

Add an alias after your last bracket.

select count(*) from 
(select idCover from x90..dimCover group by idCover having count(*) > 1) a
RedFilter
+4  A: 
SELECT COUNT (*) FROM
 ( SELECT IdCover FROM x90..dimCover group by idCover having count(*) > 1) AS a

(note the alias at the end)

Frederik Gheysels