SQL:Insert
lastmod 2026-01-02created 2026-01-021 edits
Skipping existing rows and adding only new ones when INSERTing multiple rows at once
Use ON CONFLICT (컬럼명) DO NOTHING:
-- 여러 행을 한 번에 INSERT할 때 유용
-- Useful when inserting multiple rows at once
INSERT INTO categories (name) VALUES
('전자제품'),
('의류'),
('식품')
ON CONFLICT (name) DO NOTHING;
-- 이미 존재하는 카테고리는 건너뛰고, 새로운 것만 추가
-- Skip existing categories, only add new ones