1

これは有効なSQLステートメントですか

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

使用するtitle = "string"と、有効な結果が得られます。%string%を受け入れるようにこれを変更するにはどうすればよいですか?

4

1 に答える 1

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

^stringあなたが探していたので、私はそれを置いていません%string%

于 2012-04-17T04:10:59.670 に答える