我试图根据多个条件提取数据库中的行。使用代码,条件可以写为
if (type == "person" && (name == "John" || name == "David"))
现在我正在获取光标:type = ? and name = ? or name = ?
这是对的吗?因为我不知道如何表达括号,所以我不希望选择成为:((type == "person" && name == "John") || name == "David")
答案 0 :(得分:1)
... Because I don't know how to express the brackets...
像在Java中一样使用括号:
SELECT [Field List] FROM [Table Name] WHERE type = ? AND (name = ? OR name = ?)