1, query the table in a field value "contains" a string of all records of the method
If there is a Name field in the table, the query name contains all the records for "Zhang San", so you can write sql:
STIRNG strsql= "select * from table name WHERE name like '%" + "Zhang San" + "% '";
2. A method for querying all records of a field value "contained in" a string
If the Name field in the query table contains all the records of the string "Three is a good student", you can write sql:
String strsql= "select * from table name WHERE INSTR (' Zhang Three is a good student ', name) >0";
Can be queried, the Name field value in the record includes: Zhang, three, is, a, good, learning, health, Zhang San 、...... And so on all records.
Note: In the SQL string above, change the full-width symbol to a half-width symbol.
About the field "contains" and "contains in" strings in SQL