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