我试过四处寻找,但找不到如何实现 AND , | (或)组合的答案。我收到了一个错误。代码如下:
allgames = GameInfo.Get.where(["list = ? AND (lang = ? OR lang = ?)", "yes", "en", @lang]).order(:order)
我得到的错误如下:
The specified query expression syntax is not valid.
请说清楚,
问候,
答案 0 :(得分:1)
管道未在sql中使用:
where("list = ? AND (lang = ? OR lang = ?)", "yes", 'en',@lang)