In SQL should be g %
The % in python is a formatting characters
Inquire on the net for a variety of methods, no matter use, shows that it is wrong
CodePudding user response:
R 'select * from... 'try adding a rCodePudding user response:
Sql_cmd="' select * from TBL where FLD like 'g %'" 'Cursor. The execute (sql_cmd)
CodePudding user response:
Not have any backquotes ` `CodePudding user response:
In python and want to use when you want to use % format string can use the format, devoid of you turn to escape character, usage is simple, it is assumed that query the beginning of the student's field of gA=input (" please enter your initials of fuzzy query: ")
SQL="select * from tablename where student like '{}' % '". The format (a)
CodePudding user response:
"XXXX like 'g %'" or "XXXX like" g % '"CodePudding user response: