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))
I think you need to name your sub-query – e.g. aliasing it to “t” here: