Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在玩 PlayScala 和 Slick。但在 Slick2 中如何执行 Like 查询。任何文档都会更有帮助
SQL:
SELECT * FROM MyTable WHERE columnA LIKE "%s%";
尝试这个
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%';
参考