1

2 番目の文字としてan を含むすべての文字列を除外するselectステートメントを作成しようとしています。これまでのところ、私の選択ステートメントは次のとおりです。ほとんどの場合は機能しますが、理解できない理由で抜け落ちてしまうものもあります。mysql'a'

Select title, replacement_cost, rating from film where title not like "-a%" and replacement_cost = 19.99
4

2 に答える 2

2

1 文字のワイルドカードとしてアンダースコアを使用します。

Select title, replacement_cost, rating 
from film 
where title not like "_a%" 
and replacement_cost = 19.99

SQL ワイルドカード

またはSUBSTR

Select title, replacement_cost, rating 
from film 
where SUBSTR(title, 2, 1) <> 'a'
and replacement_cost = 19.99
于 2013-09-18T09:50:54.840 に答える
0

これを試してください

Select title, replacement_cost, rating from film where substr(title,2,1)!='a' and replacement_cost = 19.99
于 2013-09-18T09:49:39.583 に答える