Query for exact match of a string in SQL

前端 未结 5 2031
谎友^
谎友^ 2021-01-06 00:47

I want to query for the exact match of a string from a database table.

When I write the query as

select description from tproduct where description          


        
5条回答
  •  再見小時候
    2021-01-06 01:22

    You can use a regular expression with a special pattern for word boundaries.

    select description from tproduct 
    where description regexp '[[:<:]]diamond[[:>:]]'
    

    See REGEXP.

提交回复
热议问题