mysql query - contains?

JJunior picture JJunior · Aug 12, 2010 · Viewed 24.9k times · Source

how can i search for a particular string in mysql? I tried using contains- gives me error:

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'

Please help.

Answer

D'Arcy Rittich picture D'Arcy Rittich · Aug 12, 2010

Try

AND i.description LIKE '% DBK%'