Imagine that you want to return the number of records in a specific table. Using the COUNT function, you can do just that. Examine the following query:
SELECT COUNT(*) FROM CATALOG
When this query is executed, the number 80 is returned because there are 80 records in the Catalog table. (Note that if you run this query on your own Catalog table, the number of records returned can vary, depending on which actions you have performed on the table.)
Remember the IS NULL operator? You can use the COUNT function in a similar fashion:
SELECT COUNT (FAX) FROM CUSTOMERS
In this query, the number returned is all the records in the Customers table that have a value (other than null) for the Fax field.
0 comments:
Post a Comment