DATABASE/MYSQL 2009. 9. 4. 14:32

출처 : http://darky.egloos.com/2378550

업데이트(인서트) 할때 같은 테이블명이 중복사용되서는 안된다
sub Query로 처리해야 함.
 
insert into xt_tbl (
컬럼들 .................. )
values  (
값들.....,        (select (max(seq) + 1) from xt_tbl) )

You can't specify target table 'goodsrate' for update in FROM clause



FAILcom.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred while applying a parameter map. 
--- Check the goodsrate.insert-InlineParameterMap. 
--- Check the statement (update failed). 
--- Cause: java.sql.SQLException: You can't specify target table 'table_name' for update in FROM clause

posted by 나는너의힘
: