在PHPMyAdmin中使用if语句

时间:2011-09-14 07:32:56

标签: mysql phpmyadmin

好的我想在PHPMyAdmin

中执行此查询
update dle_post set full_story =concat(full_story ,"[H1]My List[/H1]
[RL1]") where category="283"

但想添加一些东西 如果在full_story或short_story中的“)”那么这将执行 感谢

2 个答案:

答案 0 :(得分:0)

LIKE这个?

UPDATE dle_post 
SET full_story = CONCAT(full_story ,"[H1]My List[/H1] [RL1]") 
WHERE category = "283" AND 
(full_story LIKE '%)%' OR short_story LIKE '%)%')

答案 1 :(得分:0)

添加此条件 -

...
WHERE
  category="283"
  AND (LOCATE(' )', full_story) > 0 OR LOCATE(' )', short_story ) > 0)