3
team = input("Enter the team name: ")
cursor = db.cursor()
sql = "SELECT * FROM `flash_data_archive` WHERE `event_id` IN (SELECT `alternate_id` from `event_list` where `category` = %s)" % team
cursor.execute(sql)
什么是正确的符号有用户对“团队”中输入的字符串用于在SQL subsuery类别字段使用Python变量?在MySQL子查询
修复它,非常感谢! – alpswd 2013-04-09 04:29:53
@alpswd不要忘记注册并接受有帮助的答案 – 2013-04-09 04:30:33