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
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
Hi
Im contructing a build script and would like to dump my dev db with
mysqldump so I can run a deploy script on the production server with the
update db.
I would like to construct the script so that it updates existing
tables/fields/posts and add new tables/fields/post if they do not exists
@lists.mysql.com
Subject: Re: WHERE (NOT) EXISTS problem
Michael Fischer wrote:
> Having a very bad time with the subject sorts of queries.
> Here is a simple reproduction of the problem for me.
> Perhaps I'm blind/stupid while looking at the docs,
> or there's a bug...
>
> m
PM
To: mysql@lists.mysql.com
Subject: WHERE (NOT) EXISTS problem
Having a very bad time with the subject sorts of queries.
Here is a simple reproduction of the problem for me.
Perhaps I'm blind/stupid while looking at the docs,
or there's a bug...
mysql version 5.0.24-standard
sim
ted to the people mapped to New York (michael,
daniel)?
No.
Simple misunderstanding of the docs.
EXISTS returns TRUE if it finds *any* result.
http://dev.mysql.com/doc/refman/5.0/en/exists-and-not-exists-subqueries.html
You want:
select distinct name from people where pid in (select p
Having a very bad time with the subject sorts of queries.
Here is a simple reproduction of the problem for me.
Perhaps I'm blind/stupid while looking at the docs,
or there's a bug...
mysql version 5.0.24-standard
simple schema:
mysql> desc people;
+---+--+--+-+
I appreciate the suggestion, but I'm not looking to drop anything. I
only want it as a safety net in the event that the table doesn't
already exist. I'm doing syncing of sorts, and I want the CREATE
TABLE IF NOT EXISTS so as not to throw errors in the event that the
table
DROP TABLE IF NOT EXISTS?
On 1/16/06, Michael Williams <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> Having a bit of mysqldump trouble again. I've looked over the
> documentation (again) and can't seem to find the flag to make
> 'mysqldump' out pu
Hi All,
Having a bit of mysqldump trouble again. I've looked over the
documentation (again) and can't seem to find the flag to make
'mysqldump' out put "CREATE TABLE IF NOT EXISTS". Any ideas?
Regards,
Michael
--
MySQL General Mailing List
For list ar
Hello.
You can parse the output of 'SHOW CREATE TABLE' or 'SHOW COLUMNS'. See:
http://dev.mysql.com/doc/mysql/en/show-columns.html
http://dev.mysql.com/doc/mysql/en/show-create-table.html
Claire Lee wrote:
> I want to check if a column exists in a table before I
> do an alter ta
Hi,
2005/9/26, Peter Brawley <[EMAIL PROTECTED]>:
> Claire,
>
> >I want to check if a column exists in a table before I
> >do an alter table to add it. How do I do this in
> >mysql? Thanks.
other solution, do your query in all case and check for the return
error (if any).
mysql> alter table
Claire,
>I want to check if a column exists in a table before I
>do an alter table to add it. How do I do this in
>mysql? Thanks.
If you are using MySQL 5.0, query information_schema.columns
(http://dev.mysql.com/doc/mysql/en/columns-table.html) for the table and
column. Otherwise use SHOW COL
I want to check if a column exists in a table before I
do an alter table to add it. How do I do this in
mysql? Thanks.
Claire
__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
MySQL Genera
At 7:10 PM -0700 8/17/05, Daevid Vincent wrote:
Does mySQL have a way to INSERT a new record if one doesn't exist (based
upon primary compound key)?
I see this "EXISTS" but not an example of how to use it with INSERT.
I see "INSERT... ON DUPLICATE KEY UPDATE col_name=expr" which is very close,
At 19:10 -0700 8/17/05, Daevid Vincent wrote:
Does mySQL have a way to INSERT a new record if one doesn't exist (based
upon primary compound key)?
Isn't that how INSERT works already?
If what you mean is that you want no error to occur, perhaps you want
to use INSERT IGNORE instead.
http://de
Daevid Vincent wrote:
Does mySQL have a way to INSERT a new record if one doesn't exist (based
upon primary compound key)?
I see this "EXISTS" but not an example of how to use it with INSERT.
I see "INSERT... ON DUPLICATE KEY UPDATE col_name=expr" which is very close,
but I want it to do nothin
Does mySQL have a way to INSERT a new record if one doesn't exist (based
upon primary compound key)?
I see this "EXISTS" but not an example of how to use it with INSERT.
I see "INSERT... ON DUPLICATE KEY UPDATE col_name=expr" which is very close,
but I want it to do nothing on duplicate key. :(
I'm writing an install script and need to create an index if it does not
exists.
I've tried SQL statements but none of them work.
Basically I'm looking to do something like
$sql[] = "ALTER TABLE `exp_members` ADD INDEX IF NOT EXIST
`idx_members_username` ( `username` )
In article <[EMAIL PROTECTED]>,
Adaikalavan Ramasamy <[EMAIL PROTECTED]> writes:
> This seems more like the solution I want. I am using perl-DBI and when
> there is an error (i.e. duplicate insert), the rest of the scrip it not
> executed. But this is gives me the following error. What am I doing
On Mon, 26 Jul 2004 17:47:37 +0100, Adaikalavan Ramasamy
<[EMAIL PROTECTED]> wrote:
> This seems more like the solution I want. I am using perl-DBI and when
> there is an error (i.e. duplicate insert), the rest of the scrip it not
> executed. But this is gives me the following error. What am I doin
Adaikalavan Ramasamy <[EMAIL PROTECTED]> wrote on 26/07/2004
16:31:44:
> But I have another related question. How do I write an IF ELSE command
> with MYSQL. In this context, I want it to return myID if the record
> already exists, otherwise insert into database.
>
> This naive syntax does not w
Yes, this does what I want and does not produce an error (which caused
the remaining MYSQL syntax not to be executed). The firstname, lastname
was for example only. In my problem, these are two different identifiers
so I am not worried about multiple dual identifiers.
Thanks to Keith Ivey, Alec Ca
Adaikalavan Ramasamy wrote:
This naive syntax does not work :
IF EXISTS (SELECT myID FROM tb WHERE firstname='Jack' AND
lastname='Doe') ELSE (INSERT INTO tb(firstname, lastname) VALUES
('Jack', 'Doe');
Assuming you have the unique index on (firstname, lastname), just do
INSERT IGNORE INTO tb (fir
> ...
> If you specify the ON DUPLICATE KEY UPDATE clause (new in MySQL 4.1.0),
> and a row is inserted that would cause a duplicate value in a UNIQUE index
> or PRIMARY KEY, an UPDATE of the old row is performed.
> ...
>
>
> there is no IF NOT EXISTS syntax in INSERT
clause (new in MySQL 4.1.0),
and a row is inserted that would cause a duplicate value in a UNIQUE index
or PRIMARY KEY, an UPDATE of the old row is performed.
...
there is no IF NOT EXISTS syntax in INSERT, but you could make use of the
ON DUPLICATE KEY mechanism. Assuming you create a unique index
;
> > +--+---+--+
> > | myID | firstname | lastname |
> > +--+---+--+
> > |1 | John | Doe |
> > |2 | Jack | Doe |
> > |3 | John | Smith|
> > +--+---+--+
> >
);
SELECT * from tb;
+--+---+--+
| myID | firstname | lastname |
+--+---+--+
|1 | John | Doe |
|2 | Jack | Doe |
|3 | John | Smith|
+--+---+--+
I get syntax error with the following :
INSERT INTO tb
x27;Smith');
> SELECT * from tb;
> +--+---+--+
> | myID | firstname | lastname |
> +--+---+--+
> |1 | John | Doe |
> |2 | Jack | Doe |
> |3 | John | Smith|
> +--+---+--+
>
> I get syntax
|
|2 | Jack | Doe |
|3 | John | Smith|
+--+---+--+
I get syntax error with the following :
INSERT INTO tb (firstname, lastname) VALUES ('Jack', 'Doe') IF NOT
EXISTS ( SELECT * FROM tb WHERE firstname='Jack' AND lastname
]
Sent: Friday, June 18, 2004 2:38 PM
To: Anton Ivanov
Cc: [EMAIL PROTECTED]
Subject: Re: EXISTS/NOT EXISTS
Subqeries require mysql 4.1.
The manual offers some suggestions on rewriting subqueries as JOINs
<http://dev.mysql.com/doc/mysql/en/Rewriting_subqueries.html>.
In your case, yo
product". I try
SELECT product from products WHERE NOT EXISTS (SELECT DISTINCT * from
products_by_product_areas WHERE products_by_product_areas.product =
products.product);
Both of these queries run fine on their own. It looks to me that I'm
simply adapting from the manual, but all I g
PROTECTED]>
Sent: Friday, June 18, 2004 10:16 PM
Subject: EXISTS/NOT EXISTS
Hi, I'm trying to figure out how to apply these from the manual, but to
no avail. Is it possible that my version (4.0.18) does not implement
these?
I have two tables: products and products_by_product_area. Bot
Hi, I'm trying to figure out how to apply these from the manual, but to
no avail. Is it possible that my version (4.0.18) does not implement
these?
I have two tables: products and products_by_product_area. Both have a
field "product". I try
SELECT product from products W
At 14:42 -0800 3/2/04, Mark Brunkhart wrote:
I apologize if this has been discussed or reported as a bug (I searched a bit
but couldn't find mention of it).
When you create a table using the CREATE TABLE IF NOT EXISTS...SELECT syntax,
what is the correct behavior if the table already exist
I apologize if this has been discussed or reported as a bug (I searched a bit
but couldn't find mention of it).
When you create a table using the CREATE TABLE IF NOT EXISTS...SELECT syntax,
what is the correct behavior if the table already exists?
I had thought that no action at all wou
all class_name from classes that aren't
> represented a specific year.
>
> So what I want as result is HD, DD, MD
> I'm trying to use the following query:
>
> SELECT class_name FROM classes WHERE NOT EXISTS (SELECT * FROM champions
> WHERE champions.class_name=classes.
D, DD, MD
>
> I'm trying to use the following query:
>
>
> SELECT class_name FROM classes WHERE NOT EXISTS (SELECT * FROM champions WHERE
> champions.class_name=classes.class_name AND champions.year='1981')
>
>
> ERRORREPORT:
>
> #1064 - You have an
- Original Message -
From: "Carl Schéle, IT, Posten" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 09, 2004 3:05 PM
Subject: WHERE NOT EXISTS
I use php 4.1.1. mysql 3.23.49 and phpmyadmin 2.5.4
I have
)
1981 HS PETER
1981 DS ANNE
What I want to do is to list all class_name from classes that aren't represented a
specific year.
So what I want as result is HD, DD, MD
I'm trying to use the following query:
SELECT class_name FROM classes WHERE NOT EXIS
Stored procedures are MySQL are real new so I don't have much experience with them
yet. The manual does seem to include some good info but I haven't delved too deeply.
MaxDB is actually a separate DB. It is a re-brand of SAP DB. You might look for SAP DB
info. It would probably apply to MaxDB.
to see if MySQL has
already had such a kind of feature like 'if not exists' but may be
implemented in a different way so I don't have to make my own workaround.
The application software that accesses the backend database is a comercial
software. We don't have the source code an
First, please be aware that MySQL 5.0 is an alpha release. It is very young and there
may still be some unresolved issues. It is not generally recommended to use alpha
releases in production situations. Besides, anything that can be done in a stored
procedure can be implemented in client side c
Greetings,
We're trying to migrate an application from MS SQL Sever 2000 to MySQL
5.0. Choosing version 5.0 of MySQL is because its support of stored
procedure is needed. We have a stored procedure doing something as shown
below on the MS SQL Server 2000:
IF NOT EXISTS (SELECT stat
Many thanks Chris
-Original Message-
From: Chris Elsworth [mailto:[EMAIL PROTECTED]
Sent: 15 December 2003 11:22
To: Curley, Thomas
Cc: [EMAIL PROTECTED]
Subject: Re: NOT EXISTS
On Mon, Dec 15, 2003 at 10:59:32AM -, Curley, Thomas wrote:
> Guys
>
> Any idea why this query
"Curley, Thomas" <[EMAIL PROTECTED]> wrote:
>
> Any idea why this query will not work in 4.0.13
>
> select batch_id from BATCH
> where NOT EXISTS (select 1 from TXN where TXN.batch_id =3D BATCH.batch_id=
> )
>
> You have an error in your SQL syntax n
On Mon, Dec 15, 2003 at 10:59:32AM -, Curley, Thomas wrote:
> Guys
>
> Any idea why this query will not work in 4.0.13
>
> select batch_id from BATCH
> where NOT EXISTS (select 1 from TXN where TXN.batch_id = BATCH.batch_id)
>
> You have an error in your SQL syn
Guys
Any idea why this query will not work in 4.0.13
select batch_id from BATCH
where NOT EXISTS (select 1 from TXN where TXN.batch_id = BATCH.batch_id)
You have an error in your SQL syntax near 'EXISTS (select * from TXN where
TXN.batch_id = BATCH.batch_id)' at line
Director General: NEFACOMP wrote:
To me, I think that is a bug and should be reported to MySQL. When the IF
condition is false, it should break the rest of the statement.
Exactly what I thought :-)
and Antony Dovgal responded:
For me this is not a bug, just poorly documented feature.
So, Hassan
On Mon, 29 Sep 2003 16:02:23 +0200
"Director General: NEFACOMP" <[EMAIL PROTECTED]> wrote:
> For me, I think he may use two statements:
> 1. Create the table if it does not exist.
> 2. Insert data if that will not create duplicates.
Yep, IMHO this is the only solution.
> Another alternative is to
.
/* This is the first instruction for creating the table */
CREATE TEMPORARY TABLE IF NOT EXISTS
showcase (
PRIMARY KEY (product)
);
/* This is the second instruction for dumping records */
INSERT IGNORE INTO showcase
SELECT product FROM productList
On Mon, 29 Sep 2003 15:16:57 +0200
"Director General: NEFACOMP" <[EMAIL PROTECTED]> wrote:
> Now, do you think I was right in my rephrasing?
> To me, I think that is a bug and should be reported to MySQL. When the IF
> condition is false, it should break the rest of the statement.
> What is your v
finds that the table *does* already exist.
===
Is there a problem with 'IF NOT EXISTS' in the following scenario?
This statement creates the table as expected ...
CREATE TEMPORARY TABLE IF NOT EXISTS
showcase (
PRIMARY KEY (product)
On Mon, 29 Sep 2003 12:30:28 +0200
"Director General: NEFACOMP" <[EMAIL PROTECTED]> wrote:
> It seems Victoria didn't understand the real problem:
>
> I think that query should be stopped as soon as the table exists.
> But if it doesn't exist, the query should create it and insert some records.
>
lt;[EMAIL PROTECTED]>
Sent: Monday, September 29, 2003 11:37
Subject: Re: 'IF NOT EXISTS' ignored?
> Hassan Schroeder <[EMAIL PROTECTED]> wrote:
> > Is there a problem with 'IF NOT EXISTS' in the following scenario?
> >
> > This stat
Hassan Schroeder <[EMAIL PROTECTED]> wrote:
> Is there a problem with 'IF NOT EXISTS' in the following scenario?
>
> This statement creates the table as expected ...
>
> CREATE TEMPORARY TABLE IF NOT EXISTS
>showcase (
>
Is there a problem with 'IF NOT EXISTS' in the following scenario?
This statement creates the table as expected ...
CREATE TEMPORARY TABLE IF NOT EXISTS
showcase (
PRIMARY KEY (product)
)
SELECT product FROM productList
.. but re-running it
ed say a
> freezer:
>
> if you do
>
> select customer from table where purchase != "freezer"
>
> you'll get all the INSTANCES of customer purchasing something other than
> a freezer. i.e. you'll get c1,c2,c3. although c1 did purchase a freezer.
>
> my b
Dear Murad,
> I know you can emulate an 'exists' subquery with a join. but I just
> can't think of a way to emulate a 'not exists' without a subquery.
> probably due to my limited sql experience. any hints?
You have probably tried something like SELECT ... WHE
; subquery with a join. but I just
> > can't think of a way to emulate a 'not exists' without a subquery.
> > probably due to my limited sql experience. any hints?
>
> You have probably tried something like SELECT ... WHERE IS NOT
> NULL. To emulate a "not
all the INSTANCES of customer purchasing something other than
a freezer. i.e. you'll get c1,c2,c3. although c1 did purchase a freezer.
my best guess of how to do this in SQL was
select distinct t1.customer from table as t1 where not exists (select
NULL from table as t2 where t1.customer = t2
SELECT * FROM table1 t1 LEFT OUTER JOIN table2 t2 ON t1.field1=t2.field2
WHERE t2.field2 IS NULL
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]] On Behalf Of Murad Nayal
> Sent: Monday, December 09, 2002 11:38 AM
> To: MySQL List
> Subject:
Hello all,
I need to run query like (in mysql < ver.4):
select * from table1 as t1 where not exists (select NULL from table2 as
t2 where t1.field1 = t2.field1)
I know you can emulate an 'exists' subquery with a join. but I just
can't think of a way to emulate a 'not exi
mm.mysql-2.0.14 driver.
patdc> I'm using MySQL 3.23.53.
patdc> The SQL I then got is:
patdc> 1. create temporary table if not exists
patdc> Highscores_result ( position int, name varchar(255),
patdc> country varchar(255), score int )
patdc>
intervals in the ranks (I want to ask
the question "show me position 200-300), I figured I needed to use a temporary table.
All my tables are innodb tables.
I'm doing this in Java using the mm.mysql-2.0.14 driver.
I'm using MySQL 3.23.53.
The SQL I then got is:
1. create t
John Ragan wrote:
>try corereader. it will run queries against your
>mysql, oracle, and ms sql server (and anything else
>laying around). you can switch between your servers
>with a click.
>
>
Am I the only one getting tired of these non-SQL related advertising
responses? Feel free to pu
ok.
> At 10:10 -0400 10/11/02, Michael T. Babcock wrote:
> >John Ragan wrote:
> >
> >>try corereader. it will run queries against your mysql, oracle,
> >>and ms sql server (and anything else laying around). you can
> >>switch between your servers with a click.
> >>
> >Am I the only one gett
At 10:10 -0400 10/11/02, Michael T. Babcock wrote:
>John Ragan wrote:
>
>>try corereader. it will run queries against your mysql, oracle,
>>and ms sql server (and anything else laying around). you can
>>switch between your servers with a click.
>>
>Am I the only one getting tired of these non-
Victor Kirk wrote:
>>If so, this should work:
>>
>> SELECT u.uname
>> FROM users u
>> LEFT JOIN team_members t ON u.user_id =3D t.user_id
>>AND t.team_id =3D 7
>> WHERE t.team_id is NULL
>>
>>
>
>Perfect :-) thanks very much this query works perfectly, you are a star.
>
>
I'd like
>> SELECT u.uname FROM users u
>> WHERE NOT EXISTS (SELECT * FROM team_members=20
>> WHERE team_id =3D 7 AND user_id=3Du.user_id);
>It sounds to me like you are trying to ask the database:
> "Tell me all the users that aren't in te
a lot of effort (my sql skills are almost no existent) I
> have the following that works with Oracle.
>
> SELECT u.uname FROM users u
> WHERE NOT EXISTS (SELECT * FROM team_members
> WHERE team_id = 7 AND user_id=u.user_id);
>
> This doesn't work
After a lot of effort (my sql skills are almost no existent) I
> have the following that works with Oracle.
>
> SELECT u.uname FROM users u
> WHERE NOT EXISTS (SELECT * FROM team_members
> WHERE team_id = 7 AND user_id=u.user_id);
>
> This does
Hello Victor,
At 04:30 PM 10/10/2002 +0100, Victor Kirk wrote:
>>> Can anyone help me? Ideally I would like something that would
>>> be portable to oracle/sql server. Efficiency is not an issue.
>
>> How about ...
>
>>SELECT * FROM teams
>>LEFT JOIN users USING (team_id)
>>WHERE u
>> After a lot of effort (my sql skills are almost no existent) I
> >> have the following that works with Oracle.
> >>
> >> SELECT u.uname FROM users u
> >> WHERE NOT EXISTS (SELECT * FROM team_members
> >> WHERE team_id = 7
From: Victor Kirk <[EMAIL PROTECTED]>
> SELECT u.uname FROM users u
> WHERE NOT EXISTS (SELECT * FROM team_members=20
> WHERE team_id =3D 7 AND user_id=3Du.user_id);
It sounds to me like you are trying to ask the database:
"Tell me all the users t
skills are almost no existent) I
>have the following that works with Oracle.
>
>SELECT u.uname FROM users u
> WHERE NOT EXISTS (SELECT * FROM team_members
> WHERE team_id = 7 AND user_id=u.user_id);
>
>This doesn't work with MySQL :-(
... until M
fort (my sql skills are almost no existent) I
VK> have the following that works with Oracle.
VK> SELECT u.uname FROM users u
VK> WHERE NOT EXISTS (SELECT * FROM team_members
VK> WHERE team_id = 7 AND user_id=u.user_id);
VK> This doesn't work with M
) I
>> have the following that works with Oracle.
>>
>> SELECT u.uname FROM users u
>> WHERE NOT EXISTS (SELECT * FROM team_members
>> WHERE team_id = 7 AND user_id=u.user_id);
>>
>> This doesn't work with MySQL :-(
>>
the following that works with Oracle.
>
> SELECT u.uname FROM users u
> WHERE NOT EXISTS (SELECT * FROM team_members
> WHERE team_id = 7 AND user_id=u.user_id);
>
> This doesn't work with MySQL :-(
>
> Can anyone help me? Ideally I would li
Oracle.
SELECT u.uname FROM users u
WHERE NOT EXISTS (SELECT * FROM team_members
WHERE team_id = 7 AND user_id=u.user_id);
This doesn't work with MySQL :-(
Can anyone help me? Ideally I would like something that would
be portable to oracle/sql server. Efficiency is n
already exists with an error. An alternative solution is running a script on
the dump file to replace all occurrences of " CREATE TABLE " with " CREATE
TABLE IF NOT EXISTS " as suggested by Clayburn. Thanks again!
John
Begin forwarded message:
From: "Clayburn W. Juniel, III" <[EMAIL PROTECTED]>
Date: Fri Oct 4, 2002 10:24:06 America/Phoenix
To: "Clayburn W. Juniel, III" <[EMAIL PROTECTED]>
Subject: Re: Create table if not exists from mysqldump?
On Friday, Oct 4, 2002, at 0
On Thursday, Oct 3, 2002, at 20:41 America/Phoenix, John Kelly wrote:
> Hi, I am trying to use mysqldump to dump the structure of a single
> database
> and want the output to make create table commands that include the IF
> NOT
> EXISTS switch so that when the file is i
John,
Friday, October 04, 2002, 6:41:46 AM, you wrote:
JK> Hi, I am trying to use mysqldump to dump the structure of a single database
JK> and want the output to make create table commands that include the IF NOT
JK> EXISTS switch so that when the file is imported into an existing database it
JK>
Kelly" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, October 04, 2002 5:19 AM
Subject: Re: Create table if not exists from mysqldump?
Hi,
Do u mean when u take a dump you need to add before
each table "drop table if exists"
then here is the command.
mysqldump -u -p
p the
> structure of a single database
> and want the output to make create table commands
> that include the IF NOT
> EXISTS switch so that when the file is imported into
> an existing database it
> does not write over tables with the same name. Does
> anyone know if this is
>
Hi, I am trying to use mysqldump to dump the structure of a single database
and want the output to make create table commands that include the IF NOT
EXISTS switch so that when the file is imported into an existing database it
does not write over tables with the same name. Does anyone know if
On Tue, Jul 09, 2002 at 08:51:05PM -0700, Todd Cary wrote:
> In my mysql dump of a DB using the -B switch, I get
>
> CREATE DATABASE /*!32312 IF NOT EXISTS*/ sfyc;
>
> What is the significance of /*!32312 IF NOT EXISTS*/ - the
> "/*!32312"? Isn't the statement
In my mysql dump of a DB using the -B switch, I get
CREATE DATABASE /*!32312 IF NOT EXISTS*/ sfyc;
What is the significance of /*!32312 IF NOT EXISTS*/ - the "/*!32312"? Isn't
the statement commented out?
With the CREATE TABLE, what happens if the table already exists?
Tod
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
(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 pr
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 I
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
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
(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 13 May 2002 17:49, John Doe wrote:
> Simle query request: I want to display the ID for everyone in a table who
> is NOT in a second table.
>
> so this is what I have come up with
>
> SELECT student.SID, student.firstName
> FROM student
> WHERE student.SID NOT IN
> (SELECT msoccerros
At 03:49 PM 5/13/2002, you wrote:
>Simle query request: I want to display the ID for everyone in a table who
>is NOT in a second table.
>
>so this is what I have come up with
>
>SELECT student.SID, student.firstName
>FROM student
>WHERE student.SID NOT IN
> (SELECT msoccerroster.SID
> FR
page does what you are wanting.
-Original Message-
From: John Doe [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 14 May 2002 7:27
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Stupid - I just can't get it (NOT IN or NOT EXISTS)
Well that is really dumb because on page:
www.mysq
TED]]
Sent: Monday, May 13, 2002 5:57 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Stupid - I just can't get it (NOT IN or NOT EXISTS)
Well that is really dumb because on page:
www.mysql.com/doc/A/N/ANSI_diff_Sub-selects.html
it gives me a manual page oh the syntax of how to use it.
MySQL doesn't support Sub-Selects yet...
http://www.mysql.com/doc/A/N/ANSI_diff_Sub-selects.html
Gurhan
-Original Message-
From: John Doe [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 4:49 PM
To: [EMAIL PROTECTED]
Subject: Stupid - I just can't get it (NOT IN or
1 - 100 of 122 matches
Mail list logo