高洛峰2017-04-18 09:36:51
You can try not to spell the SQL statement yourself, but use the functions that come with the system library, such as
results = cur.select(table = 'articles', columns = ['id','link','is_keywords_avaliable'], where = correct_parms) # 具体的参数我也记得不清楚,可以自己查查看。
Use format strings to easily replace parameters.
sql = "select {columns} from {table} {is_where} {condition}".format(columns = 'id, link, is_keywords_available', table = 'articles', is_where = "where", condition = ".....")