sqlite3: Select 列项根据不同列项的值
Sqlite3: Select column items based on the value of different column items
这是我的 table,它根据给定主题的主题显示问题:
你可以看到目前所有的主题和主题都是一样的,我会随着时间的推移添加更多,这只是一个测试。
无论如何,我知道我可以 select 来自 table(命名问题)的问题使用:
select question from questions
但是我只想 select 来自某个主题的问题,例如我只想 select 来自主题 'The Fundamentals of Chemistry' 的问题。 (我知道我在数据库中拼错了 fundamentals)。
我也在用这个做 flask 网站,谢谢你的帮助。
SELECT question FROM questions WHERE topic="The Fundementals of Chemistry"
我猜...
select * from question where topic='The Fundamentals of Chemistry'
这应该有帮助
这是我的 table,它根据给定主题的主题显示问题:
你可以看到目前所有的主题和主题都是一样的,我会随着时间的推移添加更多,这只是一个测试。
无论如何,我知道我可以 select 来自 table(命名问题)的问题使用:
select question from questions
但是我只想 select 来自某个主题的问题,例如我只想 select 来自主题 'The Fundamentals of Chemistry' 的问题。 (我知道我在数据库中拼错了 fundamentals)。
我也在用这个做 flask 网站,谢谢你的帮助。
SELECT question FROM questions WHERE topic="The Fundementals of Chemistry"
我猜...
select * from question where topic='The Fundamentals of Chemistry'
这应该有帮助