I think I sorted it out ...

INSERT INTO master_comments (comment_no,comment_text,language_id)
SELECT comment_no,comment_text,language_id from mComments
WHERE NOT EXISTS 
(
SELECT comment_no 
FROM master_comments 
WHERE mComments.comment_no = master_comments.comment_no
);

Hope this helps someone else
.....





-----Original Message-----
From: roger.maynard [mailto:[EMAIL PROTECTED] 
Sent: 23 January 2008 18:58
To: mysql@lists.mysql.com
Subject: INSERT WHERE NOT EXISTS syntax

Can anyone tell me why this isn't working... v5.0

 

INSERT INTO master_comments (comment_no,comment_text,language_id)

SELECT comment_no,comment_text,language_id from mComments

WHERE NOT EXISTS (SELECT comment_no FROM master_comments);

 

I thought I had it working once but now it isn't?

 

Roger


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to