Error message here!

Hide Error message here!

忘记密码?

Error message here!

请输入正确邮箱

Hide Error message here!

密码丢失?请输入您的电子邮件地址。您将收到一个重设密码链接。

Error message here!

返回登录

Close

JPA fuzzy query like Oracle and MySQL

sinat_ thirty-six million two hundred and seventy-nine thousand 2022-05-14 15:58:46 阅读数:1 评论数:0 点赞数:0 收藏数:0

mysql How to write it :like %: Parameters %, See the figure below for details

 @Query(value = "select * from base_area where pcodes like %:pcodes% ", nativeQuery = true)
List<Area> findByIsDeletedAndPcodesLike(@Param("pcodes") String pcodes);

oracle How to write it :like '%'||: Parameters ||'%', See the figure below for details

 @Query(value = "select * from base_area where pcodes like '%'||:pcodes||'%' ", nativeQuery = true)
List<Area> findByIsDeletedAndPcodesLike(@Param("pcodes") String pcodes);

Copyright statement
In this paper,the author:[sinat_ thirty-six million two hundred and seventy-nine thousand],Reprint please bring the original link, thank you