Re: Subselect in an Update query

2005-06-18 Thread Jochem van Dieten
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

Re: Subselect in an Update query

2005-06-17 Thread Ed Reed
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

Re: Subselect in an Update query

2005-06-17 Thread Ed Reed
** 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 | +--+--+

Re: Subselect in an Update query

2005-06-17 Thread Eric Bergen
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

Re: Subselect in an Update query

2005-06-17 Thread Ed Reed
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

Re: Subselect in an Update query

2005-06-17 Thread mfatene
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

Re: Subselect in an Update query

2005-06-17 Thread SGreen
"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"

Subselect in an Update query

2005-06-17 Thread Ed Reed
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

Re: [Newbie] Slow slave update.

2005-06-14 Thread Nico Alberti
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

Re: How to update with select a spatial value ?

2005-06-12 Thread Jigal van Hemert
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`));

SQL: How to update with select a spatial value ?

2005-06-11 Thread Pete Lancashire
+ | 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

Re: [Newbie] Slow slave update.

2005-06-10 Thread Atle Veka
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

Re: [Newbie] Slow slave update.

2005-06-10 Thread Nico Alberti
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

Re: [Newbie] Slow slave update.

2005-06-09 Thread Atle Veka
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

Re: [Newbie] Slow slave update.

2005-06-09 Thread Gleb Paharenko
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

[Newbie] Slow slave update.

2005-06-09 Thread Nico Alberti
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

Re: update / subquery

2005-05-28 Thread Jochem van Dieten
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

Re: update / subquery

2005-05-28 Thread Lieven De Keyzer
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

Re: update combine values

2005-05-26 Thread mfatene
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; ++---+--

RE: update combine values

2005-05-25 Thread Peter Normann
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;

update combine values

2005-05-25 Thread Ismet Dere
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

Re: ON DUPLICATE KEY UPDATE and AUTO_INCREMENT columns

2005-05-20 Thread mfatene
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

Re: ON DUPLICATE KEY UPDATE and AUTO_INCREMENT columns

2005-05-19 Thread Sven Paulus
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

Re: ON DUPLICATE KEY UPDATE and AUTO_INCREMENT columns

2005-05-19 Thread mfatene
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

ON DUPLICATE KEY UPDATE and AUTO_INCREMENT columns

2005-05-19 Thread Sven Paulus
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,

Re: Update Email Column

2005-05-19 Thread mfatene
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

Re: Update Email Column

2005-05-19 Thread mfatene
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

Re: Update Email Column

2005-05-19 Thread Ian Sales (DBA)
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

Update Email Column

2005-05-19 Thread shaun thornburgh
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

Re: mysql client update

2005-05-18 Thread Eric White
> >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

Re: mysql client update

2005-05-17 Thread David Logan
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

RE: mysql client update

2005-05-17 Thread mfatene
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

RE: mysql client update

2005-05-17 Thread Philip Denno
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

mysql client update

2005-05-17 Thread Eric White
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

Re: if no lock at all for update

2005-05-15 Thread mfatene
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

if no lock at all for update

2005-05-15 Thread Pengz9
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

RE: UPDATE Query

2005-05-12 Thread Partha Dutta
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

UPDATE Query

2005-05-12 Thread shaun thornburgh
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

Re: update and select question

2005-04-27 Thread Jigal van Hemert
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>

Re: update and select question

2005-04-27 Thread Philippe Poelvoorde
$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

Re: update and select question

2005-04-27 Thread mfatene
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

FW: update and select question

2005-04-26 Thread J.R. Bullington
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

update and select question

2005-04-26 Thread 黄高峰
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!!

update and select question

2005-04-26 Thread 黄高峰
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!!

Re: problem with update statement

2005-04-25 Thread ragan_davis
, 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

Re: problem with update statement

2005-04-25 Thread mfatene
--++ 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

Re: problem with update statement

2005-04-25 Thread Brent Baisley
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

problem with update statement

2005-04-22 Thread ragan_davis
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

Re: 4.0 -> 4.1 update killed my db!

2005-04-22 Thread Santino
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

Re: 4.0 -> 4.1 update killed my db!

2005-04-22 Thread Gleb Paharenko
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

4.0 -> 4.1 update killed my db!

2005-04-21 Thread m i l e s
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:

Re: Wise to update 4.1.10a to 4.1.11?

2005-04-15 Thread Joerg Bruehe
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

Wise to update 4.1.10a to 4.1.11?

2005-04-15 Thread B.Brey
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

Re: update ... where col is null problem.

2005-04-14 Thread Chris Knipe
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; +-+-

update ... where col is null problem.

2005-04-14 Thread Emil Wilmanski
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

question to locks on an update statement

2005-04-07 Thread Reto Breitenmoser
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

Re: update random date

2005-04-03 Thread Michael Stassen
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

update random date

2005-04-03 Thread Jerry Swanson
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]

General substring update query required

2005-03-27 Thread zzapper
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

Re: Getting error 136 during an update

2005-03-22 Thread Gleb Paharenko
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

RE: Getting error 136 during an update

2005-03-22 Thread mel list_php
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

Getting error 136 during an update

2005-03-22 Thread CheHax
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

Re: update command

2005-03-20 Thread David Dick
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

Re: update command

2005-03-20 Thread Rhino
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

RE: update command [problem solved]

2005-03-20 Thread Eko Budiharto
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

Re: update command

2005-03-20 Thread Rhino
- 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

update command

2005-03-20 Thread Eko Budiharto
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

Re: update a field with multiple value

2005-03-18 Thread Gleb Paharenko
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

Re: update a field with multiple value

2005-03-18 Thread SGreen
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. > >

Re: update a field with multiple value

2005-03-18 Thread Alec . Cawley
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

update a field with multiple value

2005-03-18 Thread Eko Budiharto
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

RE: Trouble performing an update

2005-03-16 Thread Gordon
You can do left joins in an update. mysql> show create table t; +---+--- -- | Table | Create Table +---+--- -- | t | CREATE TABLE `t` ( `key1`

Trouble performing an update

2005-03-16 Thread Bob Dankert
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

date of end support (security update)

2005-03-15 Thread zdust
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]

Re: INSERT ON DUPLICATE KEY UPDATE

2005-03-12 Thread Jocelyn Fournier
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<-

INSERT ON DUPLICATE KEY UPDATE

2005-03-12 Thread Aleksandr Guidrevitch
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

Re: update and get value

2005-03-04 Thread SGreen
"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 and get value

2005-03-04 Thread Scott Purcell
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

innodb update issues

2005-03-03 Thread James Nobis
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

Transparent schema update for replicated installs

2005-02-28 Thread Kevin A. Burton
(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

Re: INSERT .. SELECT ... ON DUPLICATE KEY UPDATE

2005-02-27 Thread Tom Cunningham
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]

Re: INSERT .. SELECT ... ON DUPLICATE KEY UPDATE

2005-02-25 Thread Sergei Golubchik
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

Re: INSERT .. SELECT ... ON DUPLICATE KEY UPDATE

2005-02-24 Thread SGreen
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

INSERT .. SELECT ... ON DUPLICATE KEY UPDATE

2005-02-24 Thread Tom Cunningham
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

SELECT UPDATE question

2005-02-22 Thread Ed Curtis
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]

Update Text + Text

2005-02-22 Thread A Z
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

Re: Update same table from subquery not allowed

2005-02-16 Thread Michael Stassen
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

Re: Update same table from subquery not allowed

2005-02-16 Thread matt_lists
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

Update same table from subquery not allowed

2005-02-16 Thread matt_lists
"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

RE: subquery help for an update

2005-02-16 Thread mel list_php
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

subquery help for an update

2005-02-16 Thread mel list_php
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

Re: SELECT and UPDATE together, with LIMIT? (incremental external indexing)

2005-02-07 Thread Nick Arnett
[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

Re: SELECT and UPDATE together, with LIMIT? (incremental external indexing)

2005-02-07 Thread SGreen
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 &

SELECT and UPDATE together, with LIMIT? (incremental external indexing)

2005-02-07 Thread Nick Arnett
; 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

Re: REPLACE INTO //add or update?

2005-02-07 Thread Gabriel PREDA
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/

Re: REPLACE INTO //add or update?

2005-02-07 Thread Tobias Asplund
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

REPLACE INTO //add or update?

2005-02-07 Thread Bjorn van der Neut
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

Re: COMPLICATED UPDATE

2005-01-28 Thread SGreen
"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

Re: COMPLICATED UPDATE

2005-01-28 Thread Mat
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

RE: COMPLICATED UPDATE

2005-01-28 Thread Jay Blanchard
[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

<    3   4   5   6   7   8   9   10   11   12   >