SQL queries the total number of qualified records in the database.
1. select count (*) from table; // count the number of tuples
2. select count (column name) from table; // count the number of values in a column
3. select count (*) from table where field = ""; // The total number of records that meet the condition
4. SQL _count = "select count (*) from article a where 1 = 1 ";
// In this statement, a represents the article table. You can write a. field next to it to represent the field of the table. where 1 = 1, which is equivalent to providing a where. Because 1 = 1 is always true.
You can add and a. Field = "" after the statement based on whether or not to add conditions.
Example:
SQL _count = "select count (*) from article a where 1 = 1"; if (! "". Equals (title) & title! = Null) {SQL _count + = "and a. a_title like '%" + title + "% '";}
The above section describes the total number of qualified records in the SQL query database. I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!