請問假設我想要找mysql中欄位的某字符串
該用哪個函數呢
好比說
"owogkwoeag 190 wegaweogkawoeg" "owogkwwegawegoeag 190 wegaweogkawoegser "owogkweser"我就把他刪了
只能是190
如果19或910或91不算....
該用哪個函數呢
好比說
"owogkwoeag 190 wegaweogkawoeg" "owogkwwegawegoeag 190 wegaweogkawoegser "owogkweser"我就把他刪了
只能是190
如果19或910或91不算....
LIKE
進行模糊查詢,你可以使用LOCATE()
或POSITION()
函數來實現。
假設你的表
為:
content | |
---|---|
owogkwoeag 190 wegaweogkawoeg | |
owogkwwegawegoeag 190 wegaweogkawoeg | |
owogkwesseseryeag 190 wegaweogkawoeg | |
qweqweqweqweqwe 901 |
表中content
欄位含有190
的所有記錄:
<code class="sql">delete from test where LOCATE('190', content);</code>
或
<code class="sql">delete from test where POSITION('190' IN content);</code>