Re: update query

2012-04-30 Thread Ananda Kumar
Do you just want to replace current value in client column to NEW. You can write a stored proc , with a cursor and loop through the cursor, update each table. regards anandkl On Mon, Apr 30, 2012 at 2:47 PM, Pothanaboyina Trimurthy skd.trimur...@gmail.com wrote: Hi all, i have one

RE: update query

2012-04-30 Thread Rick James
= 'dbname' information_schema.COLUMNS WHERE COLUMN_NAME = 'client' -Original Message- From: Ananda Kumar [mailto:anan...@gmail.com] Sent: Monday, April 30, 2012 2:26 AM To: Pothanaboyina Trimurthy Cc: mysql@lists.mysql.com Subject: Re: update query Do you just want to replace

RE: Update query problem

2010-09-16 Thread Travis Ard
Try using the IS NULL operator instead of ! -Travis -Original Message- From: Andy Wallace [mailto:awall...@ihouseweb.com] Sent: Thursday, September 16, 2010 10:47 AM To: mysql@lists.mysql.com Subject: Update query problem So I'm having a problem with an update query. I have three

Re: Update query question

2007-02-02 Thread ViSolve DB Team
Hi,, The Update query of yours will do fine.. otherwise try using string functions [instr()] like mysql update inventory_items set name='necklace' where instr(description,'necklace')0; Thanks ViSolve DB Team. - Original Message - From: Jerry Jones [EMAIL PROTECTED] To:

Re: Update query help

2006-12-06 Thread ViSolve DB Team
Hi, Try this.. UPDATE table2 inner join table1 on table2.playedid=table1.playerid SET table2.totalscore=sum(table1.score) Just a guess... Thanks, ViSolve DB Team - Original Message - From: Ravi Kumar. [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Wednesday, December 06, 2006

Re: Update query help

2006-12-06 Thread Remo Tex
ViSolve DB Team wrote: Hi, Try this.. UPDATE table2 inner join table1 on table2.playedid=table1.playerid SET table2.totalscore=sum(table1.score) Just a guess... Thanks, ViSolve DB Team - Original Message - From: Ravi Kumar. [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent:

Re: Update query help

2006-12-06 Thread Remo Tex
Ravi Kumar. wrote: Dear Friends, I have two tables: T1, T2. T1 has 3 columns: playerid, gameid, score T2 has 2 columns: playerid, totalscore. I wish to update table T2 such that sum of T1.score of each player, gets updated in T2.totalscore. It may be something like this: update T2, T1

Re: Update query in order to modify some fields

2006-11-17 Thread spacemarc
2006/11/17, Mike Kruckenberg [EMAIL PROTECTED]: If it's values you are updating you can use the replace() string function to do something like this: update table1 set field1=replace(field1,'the','an'); To demonstrate: mysql select replace(the-object1,the,an);

RE: Update query in order to modify some fields

2006-11-17 Thread Jerry Schwartz
, November 17, 2006 9:27 AM To: Mike Kruckenberg Cc: mysql@lists.mysql.com Subject: Re: Update query in order to modify some fields 2006/11/17, Mike Kruckenberg [EMAIL PROTECTED]: If it's values you are updating you can use the replace() string function to do something like this: update table1

Re: Update query

2006-01-24 Thread Gleb Paharenko
Hello. If dbA.id has the format you have specified MySQL should be able to silently convert the type from char to int, and you can work with dbA.id as it is integer column. mysql create table ch(id char(6)); Query OK, 0 rows affected (0.04 sec) mysql insert into ch set id='001234'; Query OK, 1

Re: Update query

2006-01-24 Thread Jørn Dahl-Stamnes
On Tuesday 24 January 2006 12:03, Gleb Paharenko wrote: Hello. If dbA.id has the format you have specified MySQL should be able to silently convert the type from char to int, and you can work with dbA.id as it is integer column. mysql create table ch(id char(6)); Query OK, 0 rows affected

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, 22)) WHERE Insertion_ID =

Re: Update Query with special conditions.

2004-11-24 Thread GH
I am curious about doing something simular to this... does anyone have an idea On Wed, 24 Nov 2004 00:43:32 -0500, list 123. list wrote: Using mySQL 4.0, I would like to know how I can code a query that will change the value of Participants.Active from Y to N is for three or more CONSECUTIVE

Re: Update query help

2004-11-05 Thread SGreen
Break it down into two steps. Compute your new values by customerid, then update your customer table with your computed data. CREATE TEMPORARY TABLE tmpFirstTran SELECT CustID, min(Datestamp) as mindate from Transactions group by CustID; update Customer c INNER JOIN tmpFirstTran ft ON ft.CustID

RE: Update query help

2004-11-05 Thread Jeff McKeon
Yeah I thought of that but was hoping not to have to use a temp table. Thanks! Jeff -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, November 05, 2004 9:25 AM To: Jeff McKeon Cc: [EMAIL PROTECTED] Subject: Re: Update query help Break it down into two

Re: update query return value

2004-09-20 Thread Brent Baisley
No, MySQL will indicate if anything in the row has changed. If you are updating with the same data, than nothing changes and MySQL doesn't waste the time to lock the table, write the data and update the indexes. It's much more efficient this way. On Sep 20, 2004, at 3:22 PM, Jeff Demel wrote:

Re: update query return value

2004-09-20 Thread Brent Baisley
I'm not following why you need to force an update? You mentioned a row refresh, but I'm not sure in what context. If you are looking to find out if a row has changed since you last read it, then you should have a timestamp field. The first timestamp field is always updated when data changes in

Re: update query return value

2004-09-20 Thread Jeff Demel
The issue is that the code doesn't know (and doesn't care) if the data is actually being changed, it's just accepting the posted form data, compiling it, and updating the record. It uses the return value (number of rows updated) to make sure there wasn't a problem updating the record.

Re: update query question

2004-07-07 Thread SGreen
Have you tried this other way of making an inner join? UPDATE products_categories AS pc INNER JOIN products AS p ON pc.prod_id = p.id SET pc.prod_sequential_id = p.id But that does not seem right our you could say: UPDATE products_categories AS pc SET pc.prod_sequential_id = pc.prod_id and

RE: update query question

2004-07-07 Thread Chris W. Parker
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] on Wednesday, July 07, 2004 11:08 AM said: Have you tried this other way of making an inner join? no i did not because i did know you could do a JOIN on an UPDATE. thanks for your suggestions i will try them out. chris. -- MySQL General Mailing

RE: update query using inner join on same table

2003-07-23 Thread Jonathan Patton
I answered my own question, this works for joining a table on itself and doing an update query: update discussion_categories discussion_categories1, discussion_categories set discussion_categories1.parent_1 = discussion_categories.category_id where

Re: update query using inner join on same table

2003-07-23 Thread Victoria Reznichenko
Jonathan Patton [EMAIL PROTECTED] wrote: I have a query that runs in Microsoft Access against my mysql database just fine. It is: UPDATE discussion_categories AS discussion_categories_1 INNER JOIN discussion_categories ON discussion_categories_1.parent_1_text =

Re: Update query with substring

2003-06-02 Thread Paul DuBois
At 11:26 +0200 5/30/03, Davy Obdam wrote: Hello people, I am trying to run this query: UPDATE table1, table2 SET table1.periode = table.periode WHERE table1.id = 3 AND SUBSTRING_INDEX( table1.name, '.', - 1 ) = table2.name But i keep getting the same error message You have an error in your

RE: Update query with substring

2003-06-02 Thread jbonnett
You can't have two tables in the UPDATE query, at least not in v3.x of MySQL. I'm not sure about version 4. That's why it's complaining about table2. I think the SUBSTRING_INDEX should be OK. You may have to split your query into a series of queries. There is some guidance in the MySQL manual.

Re: Update query with substring

2003-05-31 Thread Victoria Reznichenko
Davy Obdam [EMAIL PROTECTED] wrote: I am trying to run this query: UPDATE table1, table2 SET table1.periode = table.periode WHERE table1.id = 3 AND SUBSTRING_INDEX( table1.name, '.', - 1 ) = table2.name But i keep getting the same error message You have an error in your SQL syntax near

Re: UPDATE query doesn't work at a PHP form

2003-04-02 Thread Fred van Engen
Hi, On Wed, Apr 02, 2003 at 05:01:48PM -0300, Sibusy wrote: I'm trying to perform UPDATE with a PHP form , but the UPDATE query doesn't work anyway, returningCan't perform the update, according to code below. It doesn't return any error at PHP nor at Mysql, I have tested the variables and

re: Update query with Join

2003-03-10 Thread Egor Egorov
On Monday 10 March 2003 10:40, Hu Qinan wrote: Which records in tbl1 are to be updated are determined by an INNER JOIN with tbl2. I have tried the following: UPDATE tbl1 INNER JOIN tbl2 ON tbl1.id = tbl2.id SET tbl1.col1 = 0; UPDATE tbl1, tbl2 SET tbl1.col1 = 0 WHERE tbl1.id = tbl2.id;

Re: Update Query problem

2002-12-10 Thread Stefan Hinz, iConnect \(Berlin\)
Dear Amit, update lotjobtemp set duedate = (select duedate from importparameters); In MySQL, you need 2 queries for this: SELECT @var:=duedate FROM importparameters; UPDATE lotjobtemp SET duedate = @var; Most probably, you will want to use a WHERE clause for both statments. To make this

RE: update query confusion

2002-06-14 Thread Jay Blanchard
{snip] I can't work out why this query is also updating a TIMESTAMP col? UPDATE news SET title = 'new title', text = 'new text' WHERE id = '4' [/snip] Because, according to TFM; (http://www.mysql.com/doc/D/A/DATETIME.html) Automatic updating of the first TIMESTAMP column occurs under any of

Re: update query confusion

2002-06-14 Thread Nick Wilson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Jay Blanchard declared other column changes value. (Note that an UPDATE that sets a column to the value it already has will not cause the TIMESTAMP column to be updated, because if you set a column to its current value, MySQL

Re: update query confusion

2002-06-14 Thread Egor Egorov
Nick, Friday, June 14, 2002, 3:40:23 PM, you wrote: NW I can't work out why this query is also updating a TIMESTAMP col? It's a paticular feature of TIMESTAMP column. Read the manual: http://www.mysql.com/doc/D/A/DATETIME.html NW UPDATE news SET title = 'new title', text = 'new text'

Re: update query fails

2002-05-22 Thread Ryan Hatch
be aware... linux/unix table names are case sensitive. if you're using Win32 MySQL on your system, the query might work, but on the ISP side, if it's a *NIX system... you must have the correct capitalization. moreover, if any of your variables contain a single quote character ( ' ), it will

Re: update query produces warnings?(fixed)

2001-05-30 Thread Tyler Longren
This post can be ignored now. Turned out the datatype for the id field was set to tinyint, changed it to int and everything worked great. Tyler On Thu, 31 May 2001 00:26:12 -0500 Tyler Longren [EMAIL PROTECTED] wrote: Hello everyone, I have a database of alumni at school. Each alumnus

RE: update query produces warnings?

2001-05-30 Thread Chris Bolt
Change the id column to something larger than a TINYINT (like MEDIUMINT or INT). You should also make ID the primary key. Hello everyone, I have a database of alumni at school. Each alumnus that registers gets assigned their own id. Id's are made with mysql's auto_increment. Everything

RE: UPDATE query with ORDER BY and LIMIT

2001-02-21 Thread Carsten H. Pedersen
Hi to all! I have to use an UPDATE query with ORDER BY and LIMIT clauses. This is the query: UPDATE TBLTEST SET LOCKEDBY='test' WHERE FIELD1 LIKE 'test_' ORDER BY INS_DATE LIMIT 1; MySql tells me that I have an error in my SQL syntax near 'ORDER BY INS_DATE' at line 1. I use Mysql

RE: UPDATE query with ORDER BY and LIMIT

2001-02-21 Thread Denis Gasparin
I see the definition of update in the online manual... This is the link: http://www.mysql.com/doc/U/P/UPDATE.html and this is what is written: From MySQL manual ONLINE *** UPDATE [LOW_PRIORITY] [IGNORE] tbl_name SET col_name1=expr1, [col_name2=expr2, ...]

RE: UPDATE query with ORDER BY and LIMIT

2001-02-21 Thread Carsten H. Pedersen
:[EMAIL PROTECTED]] Sent: Wednesday, February 21, 2001 11:05 AM To: Carsten H. Pedersen; [EMAIL PROTECTED] Subject: RE: UPDATE query with ORDER BY and LIMIT I see the definition of update in the online manual... This is the link: http://www.mysql.com/doc/U/P/UPDATE.html and this is what