1

I found there is a exists function in the document of Squeryl, but I can't find an example of how to use it.

Would someone give me an example of "exists"?

Freewind
  • 193,756
  • 157
  • 432
  • 708

1 Answers1

2

You can find an example here (official squeryl example).

val studentsWithAnAddress =
  from(students)(s =>
    where(exists(from(addresses)((a) => where(s.addressId === a.id) select(a.id))))
      select(s)
  )
Freewind
  • 193,756
  • 157
  • 432
  • 708
Christian
  • 4,543
  • 1
  • 22
  • 31