[TDR Generic Table] [MySQL Protocol Compatibility Interface] COUNT
1. Interface Description
Get the number of qualified records in a specified table.
2. Preparations
Refer to Preparation document, create mysql_table table, and use MySQL Client to connect to TcaplusDB successfully.
3. SQL Examples
At present, TcaplusDB only supports the following three basic COUNT functions.
- Get the number of records in full table, and do not support filter conditions:
SELECT COUNT(*) FROM mysql_table;
- Get the number of records of
index, and do not support filter conditions:
SELECT COUNT(*) FROM mysql_table WHERE k1=1 AND k2=2;
- Get the number of records of
primarykey. The returned result can only be 0 or 1:
SELECT COUNT(*) FROM mysql_table WHERE k1=1 AND k2=2 AND k3='one';
4. FAQ
For details, see Meaning and Handling of Error Codes.
5. Other Reference Documents
None