2

做一个简单的 Squeryl 数据库查找,但试图排除一个值。我试过了:

j.id not jobExcludej.id != jobExclude

但是第一个触发编译器错误,第二个触发运行时错误。

整个交易:

from(DB.jobs)(j =>
      where((j.startTime >= todayStart)
      and (j.startTime <= todayEnd)
      and (j.userId === userId)
      and (j.teamId === teamId)
      and (j.startOrder >= index)
      and (j.id not jobExclude))
      select (j)).toList

谢谢!

4

1 回答 1

3

由 Squeryl 集团提供:

不等于是<>

所以在更大的范围内:

(job.id <> jobExclude)

http://squeryl.org/functions.html

信用https://groups.google.com/forum/?fromgroups#!topic/squeryl/Hw7iVyvLLNM

于 2012-04-05T23:15:11.923 回答