mysql 퀴리문 문의
INSERT UPDATE문이 아닌
이거 하나로 합친 명령어가 있던거 같은데.
이름이 무엇인가요??
데이터 존재 안하면 저장되고 존재하면 수정하고?
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 4개
INSERT INTO system_user
( system_user_name
, system_user_group_id
, system_user_type
, first_name
, middle_name
, last_name
, created_by
, creation_date
, last_updated_by
, last_update_date )
VALUES
('SYSADMIN'
, 1
, 1
,'Samuel'
,'the'
,'Lamanite'
, 1
, NOW()
, 1
, NOW())
ON DUPLICATE KEY
UPDATE first_name = 'Samuel'
, middle_name = 'the'
, last_name = 'Lamanite'
, last_updated_by = 1
, last_update_date = UTC_DATE();
http://dev.mysql.com/doc/refman/5.0/en/replace.html