Thursday, 15 March 2012

innodb - MySQL search TEXT field for matching text, for absolute on a multiline -



innodb - MySQL search TEXT field for matching text, for absolute on a multiline -

okay, have table in innodb. has column called "spellings" text field (not varchar). in column, have multiple ways spell something, each way separated line break. instance 1 of rows follows:

soulcalibur soul calibur

then have row information

soulcalibur ii soulcalibur 2 soul calibur ii soul calibur 2

now lets want find rows contain "soul calibur", using:

select * games spellings '%soul calibur%'

the problem returns both rows, because technically sec row have "soul calibur". there way in mysql query query soul calibur show fields contain soul calibur on line. exact match after parsing line breaks.

if remove %, doesnt work because first row technically soulcalibur\nsoul calibur

i think need utilize char(10) line breaks. seek concat('%soul calibur', char(10), '%')

mysql innodb

No comments:

Post a Comment