TABLE_A의 데이터
COLUM_1 COLUMN_2
홍길동 1
가나다 2
김막동 3
최일구 4
감자 5
영자 6
김말자 7
김영심 8
김치영 9
TABLE_B의 데이터
COLUMN_1
1
2
3
4
5
1. delete TABLE_A from TABLE_A, TABLE_B
where TABLE_A.column_2=TABLE_B.column_1;
2. delete from table_a right join table_b on table_a.colum_2=table_b.column_1;
3. delete from table_a where column_2 in (select column_1 from table_b)
위처럼 MS-SQL에서는 지울 수 있는데
MySQL((Version 3.23.58 입니다)에서는 아무리 해도 Syntax 에러만 나옵니다.
임시 테이블 B 에 있는 (1,2,3,4,5) 값을 가지고 있는 테이블 A의 모든 데이터를
삭제하고 싶은데 어떻게 해야 되나요,,,
일일이 아래처람 해야 되나요
delete from table_a where column_2=1;
delete from table_a where column_2=2;
delete from table_a where column_2=3;
delete from table_a where column_2=4;
delete from table_a where column_2=5;
|