Link to home
Create AccountLog in
Avatar of SESImage
SESImage

asked on

How to combine count(*) and top # rows in SQL

I'm trying to do this, but I get an error "Line 1: Incorrect syntax near ')'."
Select count(*) from (select top 100 * from MyTable MT order by ID desc) where MT.Column2 = 'FALSE'

MyTable
ID  Column2
1  TRUE
2  TRUE
3  FALSE
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account