gpt4 book ai didi

mysql - 如何在搜索查询 Jpa 中一起使用 Starts with 和 contains ?

转载 作者:行者123 更新时间:2023-11-29 15:50:49 25 4
gpt4 key购买 nike

我想根据“开头为”查询对结果进行排序,后跟“包含”查询的结果。如何使用 JPA、Spring 和 Mysql 来实现这一点?

最佳答案

i want to display the results in order of(starting with terms) followed by (containing terms)

这对于纯 SQL 是不可能的,因为排序发生在结果上,而不是在 where 条件的一部分上。

关于mysql - 如何在搜索查询 Jpa 中一起使用 Starts with 和 contains ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56771637/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com