does something like followin exist?
('''select * from TABLE where ? in FIELD''',(VAR))
I need to select all table rows where FIELD just contains the text of VAR (so not needed FIELD=VAR) I'm using python3 and sqlite3.
You can use the function INSTR()
:
sql = "SELECT * FROM tablename WHERE INSTR(FIELD, ?)"
or the operator LIKE
:
sql = "SELECT * FROM tablename WHERE FIELD LIKE '%' || ? || '%'"
to get the rows that contain the value of VAR
:
execute(sql, (VAR,))