如何在mysql中搜索特定的字符串? 我尝试使用contains-给我错误:
SELECT r.name
, r.network
, r.namestring
, i.name
, r.rid
, i.id
, d.dtime
, d.ifInOctets
, d.description
FROM router AS r
INNER JOIN interface AS i ON r.rid = i.rid
INNER JOIN 1278993600_1_60 AS d ON i.id = d.id
AND d.dtime BETWEEN 1279027200 AND 1279029000
WHERE r.network = "ITPN"
AND i.status = "active"
AND i.description CONTAINS ' DBK'
请帮忙。
答案 0 :(得分:12)
尝试
AND i.description LIKE '% DBK%'
答案 1 :(得分:5)
寻找LIKE
:
AND i.description LIKE '% DBK%'
更多信息:
答案 2 :(得分:1)
使用like,即AND i.description LIKE'%DBK%'
答案 3 :(得分:1)
尝试
...AND i.description like '% DBK%'
或
...AND upper(i.description) like '% DBK%'
如果您希望获得DBK
,DbK
,dbk
,dBk
,...