0

我试着环顾四周,但找不到关于如何实现AND组合的答案, | (或者)。我收到一个错误。代码如下:

allgames = GameInfo.Get.where(["list = ? AND (lang = ? OR lang = ?)", "yes", "en", @lang]).order(:order)

我得到的错误如下:

The specified query expression syntax is not valid.

请阐明一些光,

问候,

4

1 回答 1

1

sql中不使用管道:

where("list = ? AND (lang = ? OR lang = ?)", "yes", 'en',@lang)
于 2012-12-04T16:39:09.187 回答