mardi 26 avril 2016

how to write a sql query to search a sub string in column and the sub string is a variable

I have written a sql query to execute the below.

cur.execute("select * from table where column like '%s'"% (variable))

But I want it to be

cur.execute("select * from table where column contains '%s'% (variable))

Aucun commentaire:

Enregistrer un commentaire