Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试为要排除所有包含作为第二个字母的字符串select的位置编写语句。到目前为止,这是我的选择声明。它在大多数情况下都有效,但由于我不明白的原因,有些仍然会通过。mysql'a'
select
mysql
'a'
Select title, replacement_cost, rating from film where title not like "-a%" and replacement_cost = 19.99
使用下划线作为单个字符的通配符:
Select title, replacement_cost, rating from film where title not like "_a%" and replacement_cost = 19.99
SQL 通配符
或与SUBSTR
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