2
我在quotestable有如下记载:字符串操作
| quotesid | quotestags |
+----------+--------------------+
| 123 | Friendsip, Courage |
我有以下查询:
update quotestable
set quotestags = COALESCE(quotestags, '') + ', Friendship'
where quotesid = 123
update quotestable
set quotestags = COALESCE(quotestags, '') +', Courtesy'
where quotesid = 123
在第一个查询我想追加Friendship
标签在quotestag列中,但该值已经存在。我如何检查它的重复性?如果该值没有添加它。如果该值不存在,则添加它。
这是糟糕的设计。单独存储每个引号 –