Advertisement
Guest User

Untitled

a guest
Aug 30th, 2015
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.76 KB | None | 0 0
  1.     object Person extends Table("person") {
  2.       def personId = column("person_id")
  3.       def party = column("party")
  4.     }
  5.  
  6.     object Vote extends Table("vote") {
  7.       def voteId = column("vote_id")
  8.       def votingId = column("voting_id")
  9.       def personId = column("person_id")
  10.       def result = column("result")
  11.       def concerns = column("concerns")
  12.     }
  13.  
  14.     q.select(
  15.       Vote.votingId,
  16.       Person.party,
  17.       Vote.concerns,
  18.       Vote.result,
  19.       Vote.result.count().as("qty")
  20.     )
  21.     .from(Vote)
  22.     .join(Person, Person.personId == Vote.personId, db.Query2.Join.Inner)
  23.     .where(Vote.result != "?", db.Query2.Where.And)
  24.     .groupBy(Vote.votingId)
  25.     .groupBy(Person.party)
  26.     .groupBy(Vote.concerns)
  27.     .groupBy(Vote.result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement