Reputation: 8695
Just playing around with subqueries in SQL Server (I know that this problem doesn't have to be done with a subquery, but I want to know where my syntax problems are)
select count(*) from
( select id, totalcharges from tblVisits where (totalcharges <10000))
Upvotes: 1
Views: 281
Reputation: 30651
I think you need to name your sub-query - e.g. aliasing it to "t" here:
select count(*) from
( select id, totalcharges from tblVisits where (totalcharges <10000)) t
Upvotes: 6