光滑如何执行LIKE查询

时间:2015-02-10 06:10:35

标签: slick-2.0 play-slick

我正在玩PlayScala和Slick。但是如何在Slick2中执行Like查询。任何文档都会更有帮助

SQL:

SELECT * FROM MyTable WHERE columnA LIKE "%s%";

1 个答案:

答案 0 :(得分:0)

试试这个

val query = for {
  coffee <- Coffees if coffee.name like "%expresso%"
} yield (coffee.name, coffee.price)

将生成类似

的SQL
SELECT name, price FROM coffees WHERE NAME like '%expresso%';

REF