(1) Data Record Screening:
SQL = "SELECT * FROM DATA WHERE Field Name = Field Value ORDER BY Field Name"
SQL = "SELECT * FROM DATA WHERE Field Name Like '% Field Value%' ORDER BY Field Name"
SQL = "SELECT TOP 10 * From Datasheet WHERE Field Name Order By Field Name"
SQL = "SELECT * FROM DATA WHERE Field Name in ('value 1', 'value 2', 'value 3')"
SQL = "SELECT * FROM DATA WHERE Field Name BetWeen Value 1 AND Value 2"
(2) Update data record:
SQL = "Update Datasheet Set Field Name = Field Value WHERE Condition Expression"
SQL = "Update Data Table Set Field 1 = Value 1, Field 2 = Value 2 ... Field N = Value N Where Conditions Expression"
(3) Delete data records:
SQL = "Delete from Data Sheet WHERE Condition Expression"
SQL = "delete from data table" (deleted all records of data tables)
(4) Add a data record:
SQL = "INSERT INTO Data Sheet (Field 1, Field 2, Field 3 ...) Valuess (value 1, value 2, value 3 ...)"
SQL = "INSERT INTO Target Data Table Select * From Source Data Sheet" (Add record of the source data table to the target data table)
(5) Data logging statistics:
AVG (field name) draws a table column average
Count (* | field name) Statistics on the number of data lines or the number of data line counts on a certain column
Max (field name) get the largest value of a table bar
MIN (field name) gets the smallest value of a table column
SUM (field name) adds the value of the data bar
Citing the above function:
SQL = "SELECT SUM (Field Name) AS alias from Datasheet Where Condition Expression
SET RS = conn.excute (SQL)
Use RS ("alias") to get the value, and other functions are used.
(6) Establishment and deletion of data sheets:
Create Table Data Sheet Name (Field 1 Type 1 (Length), Field 2 Type 2 (Length) ...)
Example: Create Table Tab01 (Name Varchar (50), DateTime Default now ())
DROP TABLE Datasheet Name (permanently delete a data sheet)