How to use IN clause in Slick?

Viewed 8986

I have a query which is written is using slick, it is not a plain slick query. The query is a select query which fetches the records from a table called Employee. The results are of type Employee class.

Now there is a list of Strings

val nameFilter= List("Sachin","Naveen"")

and this "nameFilter" comes dynamically and it may have any number of names

var result= dbHandle.db.run((query.drop(10).take(10)).result

The variable query is just a select query for the Employee table which selects a range of records from 11 to 20.

Now I need to filter the records which have names mentioned in the 'nameFilter' and then select the records from 11 to 20. That means I need a query with 'IN' clause.

Please note that this is not a plain Slick SQL query, I have to frame a query in the above format.

1 Answers
Related