Database MYSQL - tried IF NOT EXISTS ... INSERT INTO but not working.
IF NOT EXISTS (SELECT * FROM tblabc WHERE id = 10547) THEN
INSERT INTO tblabc
(a, b, c)
SELECT a , b, c
FROM tblabc WHERE id = 10547;
END IF;
Finally, this work
INSERT INTO tblabc
(a, b, c)
SELECT a , b, c
FROM tblabc WHERE id = 10547
AND NOT EXISTS (SELECT * FROM tblabc WHERE id = 10547);
1 comment:
i really appreciate it!!...
Post a Comment