티스토리 뷰
마리아 db에서 같은 테이블에서 업데이트를 치려고 하는데 table is specified twice 이런 에러가 났다.
흠.. 구글링을 해보니
The solutions involving SELECT ... FROM (SELECT * FROM table) AS tmp just dump the entire content of a table into a temporary table, which can then be used in any further outer queries, like for example an update query. This forces the order of operations to be: Select everything first into a temporary table and then use that data (instead of the data from the original table) to do the updates.
However if the table involved is large, then this temporary copying is going to be incredibly slow. No indexes will ever speed up SELECT * FROM table.
마리아 db에서 같은 테이블에서 업데이트를 치려고 하는데 table is specified twice 이런 에러가 났다.
흠.. 구글링을 해보니 stackoverflow에서
The solutions involving SELECT ... FROM (SELECT * FROM table) AS tmp just dump the entire content of a table into a temporary table, which can then be used in any further outer queries, like for example an update query. This forces the order of operations to be: Select everything first into a temporary table and then use that data (instead of the data from the original table) to do the updates.
However if the table involved is large, then this temporary copying is going to be incredibly slow. No indexes will ever speed up SELECT * FROM table.
이런것을 봤다. 여기에 착안해서
create table test
as (select * from test2)
;
이런식으로 테스트 템프 테이블을 만들어서 템프테이블에서 값을 읽어와서 update를 치니 아주 잘되었다
'mariaDB' 카테고리의 다른 글
마리아 db 테이블 용량 보기 (0) | 2021.11.02 |
---|---|
마리아 db 계정생성 및 권한부여 select 만, 전체 (0) | 2021.01.11 |
마리아db프로시저 실행 (0) | 2020.06.26 |
마리아db regexp_replace 숫자만 추출 (0) | 2020.06.19 |
마리아db 인스턴스별 함수 만들기 (0) | 2020.06.05 |
- Total
- Today
- Yesterday
- XE
- 프로씨
- ocajp
- KG
- 파싱
- 파이썬
- webix
- 이클립스
- 라이믹스 모듈
- xe애드온
- proc
- XE3
- JDBC
- 포인터
- Python
- 자바 smtp
- 플러터
- php
- ocjap
- 인포믹스
- EC
- C언어
- 문자열
- xe addon
- C
- 스크래핑
- esql
- 자바
- 오라클
- MySQL
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |