SQLite Select 语句 - 满足两个条件的地方?
有人可以纠正我的选择语句,下面的工作原理是从表“游戏”中选择“流派=fps”的所有内容。
tx.executeSql('SELECT * FROM games WHERE genre=fps', [], renderResults);
我不知道如何做,或者是否可以扩展它来选择“genre = fps”和“decade = 90”的所有内容 - 像这样:
tx.executeSql('SELECT * FROM games WHERE genre=fps AND decade=90', [], renderResults);
或者
tx.executeSql('SELECT * FROM games WHERE genre=fps AND WHERE decade=90', [], renderResults);
以上是否可能?这可能非常简单,但我找不到任何可以遵循的示例或教程。
任何帮助都会很棒。
谢谢
Can someone please correct my select statement, the below works selecting everything from table 'games' where 'genre=fps'.
tx.executeSql('SELECT * FROM games WHERE genre=fps', [], renderResults);
I don't know how to, or if it is possible to expand upon this to to select everything where 'genre=fps' and 'decade=90' - something like this:
tx.executeSql('SELECT * FROM games WHERE genre=fps AND decade=90', [], renderResults);
or
tx.executeSql('SELECT * FROM games WHERE genre=fps AND WHERE decade=90', [], renderResults);
Is the above possible? This is probably really straightforward but I cant find any examples or tutorials to follow.
Any help would be great.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的第一次尝试是正确的,但是如果 fps 是文本值,您需要在其周围加上引号:
Your first attempt is correct, however if fps is a text value you need quotes around it: