Code

SQLite 다른 데이터베이스에서 column 가져오기

Segel 2021. 10. 7. 02:28

문제:

    column 하나를 날려먹어서 예전 버전의 파일로부터 가져와야 할 일이 생겼음

해결:

UPDATE table_to
SET
	corrupted=(
		SELECT 
        	new_db.table_from.flawless 
        FROM 
        	new_db.table_from 
        WHERE
        	new_db.table_from.flawless = table_to.corrupted
	)
FROM 
	new_db.table_from
WHERE 
	new_db.table_from.id=table_to.id
반응형