Home > database >  The same string the same rules for different data python
The same string the same rules for different data python

Time:11-26

STR="select id, age, name the from dbname where age={age} and name={name}"

Agelist=12 [which]
Namelist=[" xiaoming, xiaohong "]

The results of eventually need
"Select id, age, name the from dbname where age 12 and name==xiaoming"
"Select id, age, name the from dbname where age 12 and name==xiaohong"
"Select id, age, name the from dbname where age 13 and name==xiaoming"
"Select id, age, name the from dbname where age 13 and name==xiaohong"
"Select id, age, name the from dbname where age 14 and name==xiaoming"
"Select id, age, name the from dbname where age 14 and name==xiaohoong"


  • Related