my tabel
我需要知道如何编写这样的代码:
如果account_id 2的quiz_num_1数据不是quiz_null,则进行打印,如果account_id 2的quiz_num_1数据是quiz_null,则进行不同的打印,account_id可由变量名控制:user_account_id = 1或2
有人能帮我吗?
我试着这么做,但没有成功
mycursor.execute(f"SELECT account_id FROM quizzes_lib WHERE account_id = '{user_account_id}'AND SELECT quiz_num_1 FROM quizzes_lib WHERE quiz_num_1 = 'quiz_null'")
#mycursor.execute("SELECT quiz_num_1 FROM quizzes_lib Where quiz_num_1 = 'quiz_null'")
if mycursor.fetchall():
print("there is no quizzes in your library")
else:
print("there is __ in your library")
1条答案
按热度按时间vlju58qv1#