0
我試圖在mysql中使用LIKE運算符來計算pics_india和pics_other。mySQL LIKE管道上的查詢
我有一個關鍵詞管道(pics_india,pics_other,pics_other_france)即
pics_other_france
pics_other
pics_other|pics_other_france|pics_other|pics_other_france
pics_other_france|pics_other_france
pics_other_france|pics_india|pics_india|pics_other_france|pics_india
我的查詢是這樣的:
if(medmas.mf_mm_keywords LIKE '%pics_india%','1','0')AS Pics_Ind,
if(medmas.mf_mm_keywords LIKE '%|pics_other' OR 'pics_other|%' OR '%pics_other%' OR '%|pics_other_france' OR 'pics_other_france|%' OR '%pics_other_france%','1','0')AS Pics_Other
如果pics_other_france | pics_india或| pics_india | pics_other_france的情況下,我想只能撥打pics_india,另外pics_other計數也是錯誤的。
感謝fthiella..I試圖如你所說,現在的我Pics_ind&Pics_other的計數都是零。 –