혹시 이런 업데이트 쿼리는 안되나요...???
select count(*), old_image_id from i_photo_tbl group by old_image_id temp aa; /* 템프 테이블로 갖고 있는다.*/ update i_photo_tbl c set tptitle_image = image_id where main_flag <> '1' and aa.cnt > 1
and aa.old_image_id = c.old_image_id and substr(link_image_id,1,10) = old_image_id and old_image_id = '1998000607'
######### 이런쿼리도 알려주세요~~
update i_photo_tbl ccc set tptitle_image = (select image_id from i_photo_tbl where main_flag='1' and old_picture_id=ccc.link_image_id) where main_flag <> '1' and substr(link_image_id,1,10) = old_image_id and old_image_id = '1998000607'
Alias를 사용하는거 자체가 안되는건가요..???
위와 같은 형태의 업데이트를 가능하게 하는 방법이 있을까요..??? |