2

I would like to get a number (like 5, 1000, etc.) of rows for given query. However method "count" for query gives me ColumnOps.CountAll -- and I don't know how to get the number.

See SQ wiki for example: https://github.com/szeiger/scala-query/wiki/Counts

(for(...) yield ...).count 

Obviously one step is missing, and the question is -- what is that step?

I use explicit query route because the count is for join.

greenoldman
  • 16,895
  • 26
  • 119
  • 185

1 Answers1

1

You can get a number to do like this:

val q = (for(...) yield ...).count
q.first

I was confused by ScalaQuery document too. I recommend that you check SQ's tests to know how it use.

pokutuna
  • 71
  • 5