Sunday, 1 July 2012

Mysql error 1093 - Can't specify target table for update in FROM clause


UPDATE  table_name a,
  (SELECT
Clonum_name    s
   FROM table_name
   GROUP BY Clonum_name   
   HAVING COUNT(DISTINCT Cable_no) > 1) b
SET Clonum_name    = CONCAT(Clonum_name    ,'_',Cable_no)
WHERE a. Clonum_name    = b.s

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Powered by Blogger