2 番目の文字としてan を含むすべての文字列を除外するselect
ステートメントを作成しようとしています。これまでのところ、私の選択ステートメントは次のとおりです。ほとんどの場合は機能しますが、理解できない理由で抜け落ちてしまうものもあります。mysql
'a'
Select title, replacement_cost, rating from film where title not like "-a%" and replacement_cost = 19.99
1 文字のワイルドカードとしてアンダースコアを使用します。
Select title, replacement_cost, rating
from film
where title not like "_a%"
and replacement_cost = 19.99
またはSUBSTR
Select title, replacement_cost, rating
from film
where SUBSTR(title, 2, 1) <> 'a'
and replacement_cost = 19.99
これを試してください
Select title, replacement_cost, rating from film where substr(title,2,1)!='a' and replacement_cost = 19.99