Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create a query
Message
 
 
To
21/01/2002 09:50:12
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00607728
Message ID:
00607738
Views:
22
>I want to count the number of records in one field base on some condition (let's say field1>7)
>How should I do it?
SELECT COUNT(*) FROM mytable WHERE field1 > 7 
* or if you want to exclude records with null in the field from the count
SELECT COUNT(SomeFiled) FROM mytable WHERE field1 > 7
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform