본문 바로가기 메뉴 바로가기

개발자노트

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

개발자노트

검색하기 폼
  • what (51)
    • OS (7)
      • LINUX (7)
    • DB, Storage (24)
      • hadoop (1)
      • oracle (22)
      • mysql (1)
    • 프로그래밍언어 (16)
      • GO (0)
      • R (10)
      • JAVA (1)
      • JavaScript (0)
      • ShellScript (2)
      • Python (3)
      • react (0)
      • no pain, no gain, no job, n.. (0)
    • DEVOPS (0)
      • kubernetes (0)
      • docker (0)
      • ansible (0)
      • prometheus (0)
    • 생각 (4)
      • 프로젝트 (0)
      • book (3)
      • SelfStudy (0)
      • 운동 (0)
  • 방명록

DB, Storage/mysql (1)
DML작업할 테이블과 조건으로 가져올Table이 동일할시에 에러

delete from a_tablewhere a_table.col1 in (select a_table.col1from a_tablewhere a_table.col2 = true) * 이렇게 자기가 DML 을 진행할 table을 조건으로 사용하기위해 select 해서 가져올경우 에러가 발생한다 You can't specify target table 'a_table' for update in FROM clause * 그럴땐 select 를 다시 서브쿼리 처리하면된다(고한다) delete from a_tablewhere a_table.col1 in (select alias_name.col1from (select a_table.col1from a_tablewhere a_table.col2 = true) as a..

DB, Storage/mysql 2014. 7. 9. 15:07
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • 티스토리
  • 초대장
  • Kill
  • SYSTEM tablespace
  • 티스토리 초대
  • SYSAUX
  • 킥스타트
  • Kickstart
  • SSH
more
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바