Closed RahulKulhari closed 10 years ago
I want to convert this query def getBlogScore(word: String, blog: String): Long = Keyword.where(_.word eqs word).and(_.blog eqs blog) .fetch.map(_.score._1) .reduceLeftOption(_ + _).getOrElse(0)
def getBlogScore(word: String, blog: String): Long = Keyword.where(_.word eqs word).and(_.blog eqs blog) .fetch.map(_.score._1) .reduceLeftOption(_ + _).getOrElse(0)
into Mysql ?
How to do this?
SELECT SUM(score) FROM keyword WHERE blog = 'blog' AND word = 'word'
I want to convert this query
def getBlogScore(word: String, blog: String): Long = Keyword.where(_.word eqs word).and(_.blog eqs blog) .fetch.map(_.score._1) .reduceLeftOption(_ + _).getOrElse(0)
into Mysql ?
How to do this?