Statistics | Statements determine how many records are in the database, or determine how many records meet certain standards, which are not difficult to accomplish with ASP. If you use the correct cursor type, you can use the RecordCount property to get the number of records, of course, with the recordset. But there's a simpler way to do this is to take count (*) in your own SELECT statement, and the code looks like this:
SQL = "SELECT count (*) from Customers"
Or
SQL = "SELECT count (*) from Customers WHERE c_lastname like ' a% '"
For example, the following code selects some records and the total number of these records:
SQL = "Select C_firstname, C_lastname, COUNT (*) from Customers WHERE c_lastname like ' a% '"
But you can't achieve your purpose. The "Count" function here is actually an aggregate function, meaning to return only one line of information: Answer the question you asked. For the 1th SELECT statement, the question is "how many records are there in the Customer table?" "The query returns a single value as a response, so it cannot be combined with your regular queries." If you want to get other data, you need to use RecordCount.
Aggregate functions include AVG, MIN, Max, and sum, in addition to count.