gpt4 book ai didi

mysql - 按案例订购

转载 作者:行者123 更新时间:2023-11-29 00:46:55 25 4
gpt4 key购买 nike

这是一个有效的SQL语句吗

select title
from table
order by case when title like "%string%" then 0 else 1 end asc

如果我使用 title = "string" 我会得到有效的结果。我怎样才能改变它以便它接受 %string%

最佳答案

select title
from table
order by case when title regexp "string" then 0 else 1 end asc;

I am not putting it as ^string because you were searching for %string%.

关于mysql - 按案例订购,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10184828/

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