What's Squeryl syntax for exclusion (i.e. != )?

Go To StackoverFlow.com

2

Doing a simple Squeryl database lookup, but trying to exclude a value. I've tried:

j.id not jobExclude and j.id != jobExclude

however the first triggers a compiler error and the second triggers a runtime error.

The whole transaction:

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

Thanks!

2012-04-05 22:42
by crockpotveggies


3

Courtesy of the Squeryl Groups:

Not equals is <>

so in the bigger picture:

(job.id <> jobExclude)

See http://squeryl.org/functions.html

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

2012-04-05 23:15
by crockpotveggies
Ads