wootscootinboogie
wootscootinboogie

Reputation: 8695

Sub query issue, SQL Server 2008

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

Answers (1)

Bridge
Bridge

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

Related Questions