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?
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
(feed the hungry filters: sql, query)
On Monday 27 May 2002 2:14 pm, Victoria Reznichenko wrote:
ML Is there a simple way to do something like INSERT IF NOT EXISTS,
ML other than first doing a SELECT and checking if it returns any rows?
ML If not, that would be pretty high up on my whish
Markus,
Tuesday, May 28, 2002, 2:15:09 PM, you wrote:
You can use IGNORE keyword in INSERT statement, but it's not quite the
same as INSERT IF NOT EXIST. If you specify IGNORE, any rows that
duplicate an existing PRIMARY or UNIQUE key in the table
will be ignored in INSERT:
ML Yes, I was
(filter fodder: sql, query)
Hello group!
Quick question:
Is there a simple way to do something like INSERT IF NOT EXISTS,
other than first doing a SELECT and checking if it returns any rows?
If not, that would be pretty high up on my whish-list : )
Cheers,
Markus
--
Markus Lervik
Linux
On Monday 27 May 2002 10:59, Markus Lervik wrote:
(filter fodder: sql, query)
Hello group!
Quick question:
Is there a simple way to do something like INSERT IF NOT EXISTS,
other than first doing a SELECT and checking if it returns any rows?
If not, that would be pretty high up on my
Markus,
Monday, May 27, 2002, 4:59:30 PM, you wrote:
ML Is there a simple way to do something like INSERT IF NOT EXISTS,
ML other than first doing a SELECT and checking if it returns any rows?
ML If not, that would be pretty high up on my whish-list : )
You can use IGNORE keyword in INSERT
Is there a simple way to do something like INSERT IF NOT EXISTS,
ML other than first doing a SELECT and checking if it returns any rows?
ML If not, that would be pretty high up on my whish-list : )
You can use IGNORE keyword in INSERT statement, but it's not quite the
same as INSERT IF NOT EXIST