sql 去除重复值的问题

UPDATE aaron a,
  (SELECT
     SUBSTRING_INDEX(NAME,sname,-2)    ssname
   FROM (SELECT *
         FROM aaron AS a,
           (SELECT
              CONCAT(SUBSTRING_INDEX(NAME,'||',1),'||') AS sname
            FROM aaron) AS aa) AS aaa) aaaa
SET a.name = aaaa.ssname


去除c10-1.jpg||/c10-1.jpg||/c10-2.jpg||
变为/c10-1.jpg||/c10-2.jpg||

  

posted @ 2013-02-01 15:31  awinlei  阅读(182)  评论(0编辑  收藏  举报