27;t have this limitation
you would still run the risk of an executor error when the subquery
returns more then one record.
Try this:
UPDATE table1 a, table2 b
SET a.field1 = b.field1
WHERE b.field2 = 'Some Value'
AND a.field2 = 'Another Value'
Jochem
PS Please use single quotes to de
Thanks for the reply.
What do you mean by 'self join'?
>>> Eric Bergen <[EMAIL PROTECTED]> 6/17/05 4:39:28 PM >>>
Could you accomplish this with an update and self join?
Ed Reed wrote:
>Sorry, I thought it was easy to understand.
>
>I wanna upda
**
create table t as Select field1 From table1 Where field2="Some
Value"
Update table1 Set field1=(Select field1 From t Where field2="Some
Value")
Where field2 ="Another Value";
**
mysql> select * from upd;
+--+--+
| a | b |
+--+--+
Could you accomplish this with an update and self join?
Ed Reed wrote:
Sorry, I thought it was easy to understand.
I wanna update a field in a table with a value from the same field but from a different record of the same table.
For example, using the query in my original message
Sorry, I thought it was easy to understand.
I wanna update a field in a table with a value from the same field but from a
different record of the same table.
For example, using the query in my original message,
+--+
|RecID |FIELD1 |FIELD2
Value"
Update table1 Set field1=(Select field1 From t Where field2="Some
Value")
Where field2 ="Another Value";
**
mysql> select * from upd;
+--+--+
| a| b|
+--+--+
|1 | one |
|1 | two |
|2 | one |
|2 | two |
|1 | Un
"Ed Reed" <[EMAIL PROTECTED]> wrote on 06/17/2005 01:35:40 PM:
> Can anyone tell me how I can make this work or suggest a work around?
> Update table1 Set field1=(Select field1 From table1 Where field2="Some
Value")
> Where field2 ="Another Value"
Can anyone tell me how I can make this work or suggest a work around?
Update table1 Set field1=(Select field1 From table1 Where field2="Some Value")
Where field2 ="Another Value";
Thanks
2005/6/10, Atle Veka <[EMAIL PROTECTED]>:
> software has much to do with this, the biggest problem is your disk. :)
>
Don't understimate what a McAfee VirusScan can do on your pc's
performance :-), however, you are probably right.
--
Ciao
Nico
--
MySQL General Mailing List
For list archives: ht
From: "Pete Lancashire"
> update fooloc set location = geomfromtext('point(lat lon)');
I have no experience with spatial tables, but from the manual I conclude
that either of these should do the job:
UPDATE `fooloc` SET `location` = GeoFromWKB(point(`lat`, `lon`));
+
| lat | lon | astext(location) |
+--+--+--+
|0 |0 | NULL |
| 10 | -10 | NULL |
|1 |5 | NULL |
+--+--+--+
Lon and Lat have values, I'm trying to come up with a
On Fri, 10 Jun 2005, Nico Alberti wrote:
> 2005/6/10, Atle Veka <[EMAIL PROTECTED]>:
> > The speed of the drive will have a lot to say on how long the queries run.
> > You haven't said anything about what type of master you have, OS, mysqld
>
> Thank you all for your answers. As I said before, I w
2005/6/10, Atle Veka <[EMAIL PROTECTED]>:
> The speed of the drive will have a lot to say on how long the queries run.
> You haven't said anything about what type of master you have, OS, mysqld
Thank you all for your answers. As I said before, I was only curious,
as fortunately I don't have to rel
The speed of the drive will have a lot to say on how long the queries run.
You haven't said anything about what type of master you have, OS, mysqld
version, etc, but I would assume that your server is much much faster
(faster drives, more memory, faster bus, ...).
Are both your mysql daemons confi
Hello.
There's a lot of complains that usually slave is far behind
the master. However, the distance between them usually is not so large.
Could it be that your laptop much is weaker or not that tuned compared to the
server, and the same operation takes more time? As I know replication
thre
Hi everybody.
Is it normal that, after a massive number (300.000) of INSERTs on the
master server (that however did not take more than some minutes), my
laptop that acts as a slave needs hours to catch up? The logfile was
almost instantly transferred, but the INSERTs at the slave server seem
to re
On 5/29/05, Lieven De Keyzer wrote:
> From: Chris
>> Lieven De Keyzer wrote:
>>>
>>> UPDATE account
>>> SET role_id = (SELECT role_id FROM role WHERE rolename = "admin")
>>> WHERE username = "test"
>>>
>>> This gi
ris
Lieven De Keyzer wrote:
UPDATE account
SET role_id = (SELECT role_id FROM role WHERE rolename = "admin")
WHERE username = "test"
This gives me an:
ERROR 1064 (0): You have an error in your SQL syntax. Check the
manual that corresponds to your MySQL server version
row in set (0.00 sec)
mysql> UPDATE UserTable SET FullName = concat(FirstName,' ',MiddleName, '
',LastName);
Query OK, 1 row affected (0.19 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from usertable;
++---+--
Ismet Dere <mailto:[EMAIL PROTECTED]> wrote:
> my question is that, is it possible to combine values of multiple
> fields in another field of same table with an update statement such
> as this;
>
> UPDATE UserTable SET FullName = FirstName & MiddleName & LastName;
Hi am fairly new to mysql and need some help, i have search thru online
documents but found not much help to this.
my question is that, is it possible to combine values of multiple fields in
another field of same table with an update statement such as this;
UPDATE UserTable SET FullName
your insert fails, you try update, but if the update fails,
last_insert_id=0.
Since you have a UNIQUE index on 'value', i don't understand why you use
auto_increment ? Also, since it's unique :
select id where value = 'what you inserted' gives you the row you inserte
On 19.05., [EMAIL PROTECTED] wrote:
> If you add another command,
> mysql> insert into bla1 values (NULL, "Cello3", NULL) on duplicate key update
> whentime = NOW();
> The right ID will be used.
Yes, if I insert an new value then the ID column gets incremented. But if I
Hi,
If you add another command,
mysql> insert into bla1 values (NULL, "Cello3", NULL) on duplicate key update
whentime = NOW();
The right ID will be used.
Since last_insert_id() has a connection scope, it's better for you to use :
select max(id) from bla1;
Mathias
Selon S
ERT ... ON DUPLICATE KEY UPDATE
..., but LAST_INSERT_ID() seems to be unusable in this case.
Example:
mysql> CREATE TABLE `bla1` (
-> `id` int(10) unsigned NOT NULL auto_increment,
-> `value` varchar(255) default NULL,
-> `whentime` timestamp(14) NOT NULL,
with '@' added to the second param :
update emails set t=concat(substring_index(t,'@',1),'@mydomain.com');
:o)
Selon [EMAIL PROTECTED]:
> Hi ,
> you can. see this :
> mysql> select * from emails;
> +---+
> | t
Hi ,
you can. see this :
mysql> select * from emails;
+---+
| t |
+---+
| [EMAIL PROTECTED] |
| [EMAIL PROTECTED] |
| [EMAIL PROTECTED] |
+---+
3 rows in set (0.00 sec)
mysql> update emails set t=concat(substring_index(t
shaun thornburgh wrote:
Is it possible to update all the domain names for an email column? I
want to change everyones email address to my domain for a test site,
so can I change the email address column such that everything after @
is changed to mydomain.com?
- see REPLACE here:
http
Hi,
Is it possible to update all the domain names for an email column? I want to
change everyones email address to my domain for a test site, so can I change
the email address column such that everything after @ is changed to
mydomain.com?
Thanks for your advice
--
MySQL General Mailing List
> >Philip.
> >
> >-Original Message-
> >From: Eric White [mailto:[EMAIL PROTECTED]
> >Sent: May 17, 2005 10:44 AM
> >To: mysql@lists.mysql.com
> >Subject: mysql client update
> >
> >
> >Hi,
> >
> >Where should I look to f
This layer
would also keep track of all connected clients and would notify when a
record is modified/inserted/created.
Cheers,
Philip.
-Original Message-
From: Eric White [mailto:[EMAIL PROTECTED]
Sent: May 17, 2005 10:44 AM
To: mysql@lists.mysql.com
Subject: mysql client update
Hi,
Where sho
hen a
> record is modified/inserted/created.
>
> Cheers,
> Philip.
>
> -Original Message-
> From: Eric White [mailto:[EMAIL PROTECTED]
> Sent: May 17, 2005 10:44 AM
> To: mysql@lists.mysql.com
> Subject: mysql client update
>
>
> Hi,
>
> Where should
keep track of all connected clients and would notify when a
record is modified/inserted/created.
Cheers,
Philip.
-Original Message-
From: Eric White [mailto:[EMAIL PROTECTED]
Sent: May 17, 2005 10:44 AM
To: mysql@lists.mysql.com
Subject: mysql client update
Hi,
Where should I look to
Hi,
Where should I look to find information about
having clients notified when a table/record is
updated?
I have a situation where multiple clients will each
have an open database connection, and I would
like for them to be notified when the database is
modified by a member of the group.
Somethi
Hi,
What will happen is that the rdbms will lock the row for you, updates it and
unlock it.
This is transparent for the user.
there will be a wait (not a problem) if another user want to update the same
row. When the first transaction is committed, the second can hold a lock for
update.
There is
Hi!
If there is no any lock at all while one update a row, what it is going to
happen to my SQL database? In which cases, it might cause problems? Anyone know?
Thanks
__
Switch to Netscape Internet Service.
As low as $9.95 a
If you are trying to set the first 6 characters of your column to '11'
then you can't use SUBSTRING on the LHS, but only from the RHS:
UPDATE CSV_Upload_Data SET PRACT_ASCII =
CONCAT(SUBSTRING(PRACT_ASCII, 1, 15), '11',
SUBSTRING(PRACT_ASCII
Hi,
I am getting an error on the following query and but can't understand why,
the syntax looks fine to me!
mysql> UPDATE CSV_Upload_Data SET SUBSTRING(PRACT_ASCII, 16, 6) = '11'
WHERE Insertion_ID = 190716;
ERROR 1064 (42000): You have an error in your SQL syntax; chec
From: "$B2+9bJv(B"
(B
(B> UPDATE
(B> NGLDENHDT
(B> SET
(B> EDT_HUK_FLG = :EDT_HUK_FLG
(B> WHERE
(B> KAI_CDE = :KAI_CDE
(B> AND EDT_NUM = (SELECT MAX(EDT_NUM)
(B>FROM NGLDENHDT
(B>
$B2+9bJv(B wrote:
(B> i use this mail first .
(B>
(B> i have a problem in under sql program:
(B>
(B>
(B> UPDATE
(B> NGLDENHDT
(B> SET
(B> EDT_HUK_FLG = :EDT_HUK_FLG
(B> WHERE
(B> KAI_CDE = :KAI_CDE
(B> AN
Hi,
Look at select ... for update here :
http://dev.mysql.com/doc/mysql/en/innodb-locking-reads.html
Mathias
Selon "$B2 9bJv(B" <[EMAIL PROTECTED]>:
>
> i use this mail first .
>
> i have a problem in under sql program:
>
>
> UPDATE
> NGLDENHD
http://dev.mysql.com/doc/mysql/en/update.html
(B
(BSee the last line on the page. You cannot, in the most current stable
(Bversion of MySQL, SELECT from the table you are trying to UPDATE.
(B
(BJ.R.
(B
(B-Original Message-
(BFrom: $B2+9bJv(B [mailto:[EMAIL PROTECTED]
(BSent
WHERE KAI_CDE = :KAI_CDE_T1
(B AND EDT_NUM != '');
(B
(Bthe error message was:
(B
(BYou can't specify target table 'NGLDENHDT' for update in FROM
(Bclause
(B
(B
(Bwhat can i do ,help me ?
(B
(B
(B thank you very much!!
WHERE KAI_CDE = :KAI_CDE_T1
(B AND EDT_NUM != '');
(B
(Bthe error message was:
(B
(BYou can't specify target table 'NGLDENHDT' for update in FROM
(Bclause
(B
(B
(Bwhat can i do ,help me ?
(B
(B
(B thank you very much!!
, 2005 9:26 am
Subject: Re: problem with update statement
> Hi,
> this is an example where what you describe doesn't happen (v 4.1
> and 5.0) :
> mysql> create table ports(mac varchar(17),port_index varchar(3));
> Query OK, 0 rows affected (0.10 sec)
>
> mysql> in
--++
2 rows in set (0.00 sec)
mysql> select * from ports where mac='00:04:FB:23:5A:44';
+---++
| mac | port_index |
+---++
| 00:04:FB:23:5A:44 | 120|
+---+----+
1 row in
n
uppercase letter. I can run "select * from table where
MAC='00:04:FB:23:5A:44'" and the correct record is returned. However,
performing "update table set port_index='123' where
MAC='00:04:FB:23:5A:44'" does not work as I expected. It does update
the co
etter. I can run "select * from table where
MAC='00:04:FB:23:5A:44'" and the correct record is returned. However,
performing "update table set port_index='123' where
MAC='00:04:FB:23:5A:44'" does not work as I expected. It does update
the c
MySql creates a directory for each version and a symbolic link to the
new installed version.
If you open the terminal and do a:
ls -l /usr/local/
there should be the old releases, the new one and a symbolic link 'mysql'.
Look at the data directory in the old release directory; if you find
your ta
Hello.
What type of tables do you use? I haven't heard about significant
changes in MyISAM format. For InnoDB you should check the manual
about incompatible changes. If nothing helps I suggest you to upgrade
using mysqldump. See:
http://dev.mysql.com/doc/mysql/en/upgrading-from-4-0.html
Hi,
I updated my 4.0 install to 4.1 and now NONE of my
databases and tables show up at all.
Im on OS X.3.9.
All the files are there in the data folder, permissions are
set, what did I do wrong ? Any suggestions as to how to get it
back ?
M i l e s.
--
MySQL General Mailing List
For list archives:
Hi Bas!
Am Fr, den 15.04.2005 schrieb B.Brey um 11:27:
> We were planning to upgrade to 4.1.10a until 4.1.11 came out.
> Does 4.1.11 only contain bugfixes/security fixes?
>
> I'm trying to find out if it could be harmfull to our application if we
> switch to 4.1.11 instead of 4.1.10a.
That is h
We were planning to upgrade to 4.1.10a until 4.1.11 came out.
Does 4.1.11 only contain bugfixes/security fixes?
I'm trying to find out if it could be harmfull to our application if we
switch to 4.1.11 instead of 4.1.10a.
anyone?
with regards,
Bas J. Brey
Multimedia Developer
Magenta MultiMedia
t: Thursday, April 14, 2005 11:19 AM
Subject: update ... where col is null problem.
Hi...
I have problem with update query. Select query with the same "where" is
OK.
mysql> select AcctStartTime,AcctSessionTime from radacct where
AcctStopTime is null;
+-+-
Hi...
I have problem with update query. Select query with the same "where" is
OK.
mysql> select AcctStartTime,AcctSessionTime from radacct where
AcctStopTime is null;
+-+-+
| AcctStartTime | Ac
O A VALUES (1,2),(2,3),(3,2),(4,3),(5,2);
COMMIT;
If one connection executes a query:
SET AUTOCOMMIT = 0;
UPDATE A SET B = 5 WHERE B = 3;
and the other connection executes after the first one a query:
SET AUTOCOMMIT = 0;
UPDATE A SET B = 4 WHERE B = 2;
Then query two has to wait for a commit or r
On Apr 3, 2005, at 6:45 PM, Jerry Swanson wrote:
How to update randomly field date of datetime? I need to update
randomly on 300 records
Thanks
Use RAND(). Se the manual for details
<http://dev.mysql.com/doc/mysql/en/mathematical-functions.html>. If
that's not enough to get you go
How to update randomly field date of datetime? I need to update
randomly on 300 records
Thanks
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Hi,
I want to replace every occurence of a string with another.
The following query works fine (appears to anyway)
update tbl_websitepages set page_content=replace
(page_content,'develop','bucket');
But is there any way to get any Regexp into the substitution?
--
MySQL
storage engine" and I need some
> light on this matter.
>
> I have a table with 23,000,000 records and I want to update it with
> datas from another one with the exact same amount of rows. The 2
> tables can be linked by a primary key. Both tables are myISAM, and
> h
mysql.com
Subject: Getting error 136 during an update
Date: Tue, 22 Mar 2005 11:31:06 +0100
Hello there,
I am receiving "Got error 136 from storage engine" and I need some
light on this matter.
I have a table with 23,000,000 records and I want to update it with
datas from another one wi
Hello there,
I am receiving "Got error 136 from storage engine" and I need some
light on this matter.
I have a table with 23,000,000 records and I want to update it with
datas from another one with the exact same amount of rows. The 2
tables can be linked by a primary key. Both tables
Presumably you remembered to include
Eko Budiharto wrote:
Hi,
I am having problem with update command. I run it directy in the mysql console, it works. But when I run it from perl, it does not work.
here is the perl script
my $server2 = 'localhost';
my $db2 = '';
my
of the query also contains one space but the Perl version contains two spaces,
this could explain the different behaviour of the queries.
Did you commit the update before
inspecting it? If I recall correctly, Perl, like other languages, requires
that you commit updates before they are visible t
m: Eko Budiharto <[EMAIL PROTECTED]>
Subject: update command
To: ActivePerl@listserv.ActiveState.com, mysql@lists.mysql.com,
[EMAIL PROTECTED]
Hi,
I am having problem with update command. I run it directy in the mysql console,
it works. But when I run it from perl, it does not work.
here is the
- Original Message -
From: "Eko Budiharto" <[EMAIL PROTECTED]>
To: ; ;
<[EMAIL PROTECTED]>
Sent: Sunday, March 20, 2005 10:04 AM
Subject: update command
> Hi,
> I am having problem with update command. I run it directy in the mysql
console, it works. But
Hi,
I am having problem with update command. I run it directy in the mysql console,
it works. But when I run it from perl, it does not work.
here is the perl script
my $server2 = 'localhost';
my $db2 = '';
my $username2 = '';
my $password2 = 'connect(&q
Hello.
> but what I want to do is UPDATE variableInfo SET variable='A, B'
>WHERE variable is null;
> when I use that command, mysql does not understand the syntax.
>How to update a field with multiple value or with an array?
Multiple values could hold the SET col
Eko Budiharto <[EMAIL PROTECTED]> wrote on 03/18/2005 11:54:09 AM:
>
> Hi,
> I am trying to to update one field with multiple value.
> I tried with regulare "update" command syntax does not work. How to
> update a field with multiple value.
>
>
Eko Budiharto <[EMAIL PROTECTED]> wrote on 18/03/2005 16:54:09:
>
> Hi,
> I am trying to to update one field with multiple value.
> I tried with regulare "update" command syntax does not work. How to
> update a field with multiple value.
>
> regular updat
Hi,
I am trying to to update one field with multiple value.
I tried with regulare "update" command syntax does not work. How to update a
field with multiple value.
regular update syntax is this, UPDATE variableInfo SET variable='A' WHERE
variable is null;
but what I
You can do left joins in an update.
mysql> show create table t;
+---+---
--
| Table | Create Table
+---+---
--
| t | CREATE TABLE `t` (
`key1`
I am trying to update a link table (table with two primary keys) where I
want to update all rows where the first primary key is a set value (for
example, change key1 from 10 to 20), but I only want to update these
where the resulting primary key does not already exist in the table
(otherwise an
Hi
i am searching the date of the end of support for the different versions
of mysql
where can i find them?
thx
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Hi,
It could perhaps be related to bug #8147.
http://bugs.mysql.com/bug.php?id=8147
Regards,
Jocelyn
Aleksandr Guidrevitch a écrit :
Hi all !
I'm having problem with INSERT ... ON DUPLICATE KEY UPDATE on mysql 4.1.10
--8<--8<--8<--8<--8<--8<--8<-
Hi all !
I'm having problem with INSERT ... ON DUPLICATE KEY UPDATE on mysql 4.1.10
--8<--8<--8<--8<--8<--8<--8<--8<--8<
INSERT INTO lot_end (id, owner_id, category_id, title, current_price,
buy_price, end_time, price, bid_cou
"Scott Purcell" <[EMAIL PROTECTED]> wrote on 03/04/2005 01:42:40 PM:
> UPDATE menu_sequence SET id=LAST_INSERT_ID(id+1);
>
>
> I am writing some code that I need to actually get the menu_sequence
> from above, store it in a variable and then do a increment. I
UPDATE menu_sequence SET id=LAST_INSERT_ID(id+1);
I am writing some code that I need to actually get the menu_sequence from
above, store it in a variable and then do a increment. I do not know why I am
having trouble with this, but it looks like I would have to
String seq = "select id
question. This leaves
only the possibility of an analyze being required to update the indexes.
However, after approximately 10-20minutes the tables seem to get out of sync
badly. Queries that should take 0.0001 seconds start to take 12seconds+ After
an analyze nothing changes. After an optimize the
(Did I send this off to the list already? It doesn't seem to be updated! )
I've been thinking recently about supporting transparent schema update of
production systems in order to deliver zero downtime.
What I'm thinking of is a scenario where you use a load balancer to take
on
Thanks Shawn, Sergei.
I'll get onto the new version as soon as I can.
Tom.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Hi!
On Feb 24, Tom Cunningham wrote:
> It appears you can't combine an insert-select with an on-duplicate-key-update.
You can, since 4.1.10
(and there're some problems with name resolution there, so better wait
for 4.1.11 - search bugdb for details)
Re
Tom Cunningham <[EMAIL PROTECTED]> wrote on 02/24/2005 11:31:31 AM:
> It appears you can't combine an insert-select with an
on-duplicate-key-update.
>
> I would find it very useful if you *could* do this. I know it would be
> complicate how you would handle the syntax
It appears you can't combine an insert-select with an on-duplicate-key-update.
I would find it very useful if you *could* do this. I know it would be
complicate how you would handle the syntax for what to do when you hit
a duplicate key, could do this: update all the columns that are
d
"id".
UPDATE table2 SET active = '1' WHERE table2.id = table1.id;
is this the correct syntax?
Thanks,
Ed
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Hi,
MySql 4.0.14
How can I do this?
Update Table1, Table2 set Table1.Field1 =
Table2.Field1 + Table1.Field1 where Table1.KeyField =
Table2.KeyField
Tried the above with no success.
Field1, in both tables is of type Text.
regards
matt_lists wrote:
matt_lists wrote:
"One restriction is that currently you cannot modify a table and
select from the same table in a subquery. This applies to statements
such as |DELETE|, |INSERT|, |REPLACE|, and |UPDATE|."
Anyboyd know if this will be fixed?
Working around it with
matt_lists wrote:
"One restriction is that currently you cannot modify a table and
select from the same table in a subquery. This applies to statements
such as |DELETE|, |INSERT|, |REPLACE|, and |UPDATE|."
Anyboyd know if this will be fixed?
Working around it with a join on itself
"One restriction is that currently you cannot modify a table and select
from the same table in a subquery. This applies to statements such as
|DELETE|, |INSERT|, |REPLACE|, and |UPDATE|."
Anyboyd know if this will be fixed?
Working around it with a join on itself, is there some reaso
Found some help here:
http://forums.mysql.com/read.php?10,10572,11064#msg-11064
UPDATE Table1 SET Table1.Field1 = (
SELECT count(*) FROM Table2 WHERE Table2.Code2=Table1.Code1
)
and that query works for me, great!!
But I still don't understand why it updates properly without the WHERE
claus
Hi,
I have one table tableNames ID,name, new_name. The columns ID and name are
populated. I would like to update the field new_name from an other table
tempName (ID,nameUpdated).
The ID between the 2 tables are the same, but I don't have the info for all
the ID. (so 568 rows in my first
[EMAIL PROTECTED] wrote:
Your solution is as good as any I can think of. If your source tables
are InnoDB you could wrap your SELECT/UPDATE processing in a transaction
to help make it even more robust. It might speed things up if you omit
the offset to your LIMIT clause and just do:
Yes, they
mental
> multiplier (SELECT blah FROM foo LIMIT 0, 5000; SELECT blah FROM foo
> LIMIT 5000, 5000; etc.).
>
> After a group is added to the Lucene index, I want to update a
> column that is a flag to show that
> the record is done (TINYINT(1) UNSIGNED NOT NULL). This is to
&
; etc.).
After a group is added to the Lucene index, I want to update a column that is a flag to show that
the record is done (TINYINT(1) UNSIGNED NOT NULL). This is to support incremental indexing (and so
that if an indexing process fails or is interrupted, it will resume with minimal redunda
It simple...
if mysql_affected_rows == 2 ---> update (because replace make DELETE and
INSERT)
else if mysql_affected_rows == 1 > insert
Gabriel PREDA
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/
On Mon, 7 Feb 2005, Bjorn van der Neut wrote:
> Hello Everyone,
>
> Can someone tell me If you can find out if the replace into function has
> done an insert or an update?
It actually never does an update, it always INSERTs.
It either does an insert or delete(s) followed
Hello Everyone,
Can someone tell me If you can find out if the replace into function has
done an insert or an update?
Thanxx
Bjorn
TTV The Victory
http://www.thevictory.nl
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com
"Diana Castillo" <[EMAIL PROTECTED]> wrote on 01/28/2005 11:53:20 AM:
> how do I make a query that does this?
> update tbl_a set location_code=0 where tbl_a.country_id = (select id
from
> countries where has_zones=0)
>
The UPDATE statement (as of 4.0.4) allows y
rom countries where
has_zones=0) first, store it in a variable, then
update tbl_a set location_code=0 where tbl_a.country_id = your_variable
Diana Castillo wrote:
how do I make a query that does this?
update tbl_a set location_code=0 where tbl_a.country_id = (select id
from countries wher
[snip]
how do I make a query that does this?
update tbl_a set location_code=0 where tbl_a.country_id = (select id
from
countries where has_zones=0)
[/snip]
Read about multi-table updates here http://www.mysql.com/update
--
MySQL General Mailing List
For list archives: http://lists.mysql.com
701 - 800 of 2398 matches
Mail list logo