[mysql] INSERT NOT EXISTS 중복 방지 삽입

`hash` 칼럼이 중복된 경우 INSERT 하지 않는다.

INSERT INTO `data_test` (`name`, `hash`) 
SELECT * FROM (SELECT 'aaa','1') AS `TMP`
WHERE NOT EXISTS (
    SELECT `hash` FROM `data_test` WHERE `hash`='1'
) LIMIT 1

댓글 없음:

댓글 쓰기

[SSL] [letsencrypt] [certbot] 와일드카드 인증서 발급하기

1. 환경   ubuntu 20.x  nginx 2. 설치   apt-get install letsencrypt -y  3. 인증서 발급   ; example.com 도메인에 대해 와일드카드 인증서를 발급받는다. certbot certonly --ma...