Hi List,
We have a transactions table (~600k records). I'm trying a simple update
query, it fails.
I thought this could be due to a reserved word problem, but all names
have been escaped.
mysql UPDATE `tblTransaction` SET `TYPE` = 'Manual' WHERE (`ORDERID` =
'694215576aac60f10c9eebe4a5a39d0f
Hi,
James Graham wrote:
Hi List,
We have a transactions table (~600k records). I'm trying a simple update
query, it fails.
I thought this could be due to a reserved word problem, but all names
have been escaped.
mysql UPDATE `tblTransaction` SET `TYPE` = 'Manual' WHERE (`ORDERID
| quick_id |
+---+--+
| 1 |0 |
+---+--+
1 row in set (0.00 sec)
I have a large number of connections executing these queries:
BEGIN:
SELECT quick_id FROM quicktable FOR UPDATE;
COMMIT;
This
works well until I hit a large number of concurrent connections (around
200), when I
I'm working on a Subversion interface to MediaWiki and am struggling
with the SQL to respond to Subversion's update-report:
http://www.mediawiki.org/wiki/WebDAV
MediaWiki's revision table contains unique revision ids and the
corresponding page id. The page table contains unique page ids
lastupdated fields when i insert a record and only lastupdated when i
update the record?
thanks,
T. Hiep
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
I would use a trigger (at least for the update)
The first insert should work with now() and you can leave lastupdateted
empty
Olaf
On 9/4/07 3:01 PM, Hiep Nguyen [EMAIL PROTECTED] wrote:
Hi list,
i tried to create a table with inserted lastupdated timestamp fields:
create table
for the update)
The first insert should work with now() and you can leave lastupdateted
empty
Olaf
On 9/4/07 3:01 PM, Hiep Nguyen [EMAIL PROTECTED] wrote:
Hi list,
i tried to create a table with inserted lastupdated timestamp fields:
create table temp (
id int not null
about it.
- michael
On 9/4/07, Olaf Stein [EMAIL PROTECTED] wrote:
I would use a trigger (at least for the update)
The first insert should work with now() and you can leave lastupdateted
empty
Olaf
On 9/4/07 3:01 PM, Hiep Nguyen [EMAIL PROTECTED] wrote:
Hi list,
i
, Olaf Stein [EMAIL PROTECTED] wrote:
I would use a trigger (at least for the update)
The first insert should work with now() and you can leave lastupdateted
empty
Olaf
On 9/4/07 3:01 PM, Hiep Nguyen [EMAIL PROTECTED] wrote:
Hi list,
i tried to create a table with inserted lastupdated
() and then count on the built-in properties to
see the first one updated on every UPDATE.
The only other caveats are:
your application behaviour is now dependent on the ordering of
columns; ok in the short-term, increasingly annoying over time as
maintainence phases grow the app in complexity
Just do this...
create table temp (
id int not null primary key auto_increment,
data varchar(100),
inserted timestamp default 0,
lastupdated default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
And just use
Insert into temp (inserted ) values (NOW());
You're only inserting once, so
statement is specifically designed to set the *second*
timestamp field to now() and then count on the built-in properties to
see the first one updated on every UPDATE.
The only other caveats are:
your application behaviour is now dependent on the ordering of
columns; ok in the short-term
that you have to make sure that
every insert statement is specifically designed to set the *second*
timestamp field to now() and then count on the built-in properties to
see the first one updated on every UPDATE.
The only other caveats are:
your application behaviour is now dependent
Hi:
I use 5.0.38 on my ubuntu desktop
and I have to work with ver 3.23.56 on a solaris-based server.
The following update query:
UPDATE wine_list,FRED SET wine_list.wine_ID=FRED.WMJ_ID WHERE
wine_list.wine_ID=FRED.wine_ID;
works on 5.038, but on 3.23.56 I get the following:
ERROR 1064 (0
Hi,
Tim Johnson wrote:
Hi:
I use 5.0.38 on my ubuntu desktop
and I have to work with ver 3.23.56 on a solaris-based server.
The following update query:
UPDATE wine_list,FRED SET wine_list.wine_ID=FRED.WMJ_ID WHERE
wine_list.wine_ID=FRED.wine_ID;
works on 5.038, but on 3.23.56 I get
On Thursday 02 August 2007, Tim Johnson wrote:
Hi:
I use 5.0.38 on my ubuntu desktop
and I have to work with ver 3.23.56 on a solaris-based server.
The following update query:
UPDATE wine_list,FRED SET wine_list.wine_ID=FRED.WMJ_ID WHERE
wine_list.wine_ID=FRED.wine_ID;
works on 5.038
Is it possible to use user variables in an update statement, I can find only
scant docs on it, but they do not pertain to what I am trying to do.
Given this select:
SELECT user_id, order_status, quantity_chosen, month_price, each_price,
sales_tax, sales_tax_rate,
@NEW_each_price:=(each_price
Hi Scott,
Scott Haneda wrote:
Is it possible to use user variables in an update statement, I can find only
scant docs on it, but they do not pertain to what I am trying to do.
Given this select:
SELECT user_id, order_status, quantity_chosen, month_price, each_price,
sales_tax, sales_tax_rate
Hi all,
I'm trying to wrap my brain around folowing problem.
table main(code, field_1, field_2, field_3, , , field_51)
111, 'X', '', 'X',,,
222, '', '', 'X',,,
333, '', 'X', '' ,,,
444, '', '', '' ,,,
555, 'X','X', '' ,,,
table map(id, field)
1, 'field_1'
5, 'field_2'
9, 'field_3'
What I've done in situations like this is write SQL that generates the SQL I
need. I then pipe out to a file and pipe it back in, or just pipe from one
instance of mysql to another.
Example SQL:
SELECT
CONCAT('UPDATE main SET ', field, ' = ', id, ';')
AS update_sql
FROM map
Example command
Hello all,
I think I saw this on an earlier post but I can't find it now.
What I need to do:
1 - update data nightly into Dev Server
2 - only copy Data do not overwrite structure
3 - only update specific tables
Any advice is greatly appreciated.
David
--
MySQL General Mailing List
For list
Hi everyone,
I have a form where you fill out description from a textarea and on
submit, it updates description in mytable.
This works fine. I want to also add the current date into description in my
table.
Here's what I get:
$date = date (F d Y);
$sql = UPDATE mytable SET description
for the hit or the id, etc.)
Perhaps I'm wrong here, but my suggestion should still work wouldn't it?
insert into table1 (hits) values (hits+1) on duplicate key update;
So on a new record, all columns inserted as defaults.
hits is 0, then incremented to 1.
On an updated record, hits is just incremented
instead of this cumbersome incantation that makes you want to rip out
your hair and puch your cube-mate dead in the nose:
insert into table1 (c1,c2,c3) values (v1,v2,v3) on duplicate key
update c1=v1, c2=v2, c3=v3;
Just allow a more sane and logical:
insert into table1 (c1,c2,c3) values (v1,v2
instead of this cumbersome incantation that makes you want to rip out
your hair and puch your cube-mate dead in the nose:
insert into table1 (c1,c2,c3) values (v1,v2,v3) on duplicate key
update c1=v1, c2=v2, c3=v3;
Just allow a more sane and logical:
insert into table1 (c1,c2,c3) values (v1,v2,v3
On Wednesday 25 April 2007 23:14, you wrote:
try this:
update table1, table2
set table1.value = table2.value
where table1.id = table2.id
Thanks for the replies... It was late evening when I tried to figure out how
to do this.
Today I found the answer myself, which is exactly as described
Please, I nedd help!!
I have two tabels:
table1:
id
value
table2:
id
value
Both tables has a lot of records with identical IDs. I need to update the
table1.value with the table2.value where the id are identical.
But I cannot find any UPDATE query that can do
On Wed, April 25, 2007 23:10, Jørn Dahl-Stamnes wrote:
Please, I nedd help!!
I have two tabels:
table1:
id
value
table2:
id
value
Both tables has a lot of records with identical IDs. I need to update the
table1.value with the table2.value where the id
Hi,
I want to update a table if it meets some conditions (already exist)
and INSERT otherwise?
Right now I am doing it this way:
1. SELECT the record
2. If it exist, I UPDATE it
3. If it does not exit, I INSERT a new record
Could this be done in one query? I mean like conditional update
Hi,
what you want to look into is (depending on your version)
either INSERT ... ON DUPLICATE KEY UPDATE ... or REPLACE
http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html
http://dev.mysql.com/doc/refman/5.0/en/replace.html
/Johan
[EMAIL PROTECTED] skrev:
Hi,
I want to update
[EMAIL PROTECTED] wrote:
I want to update a table if it meets some conditions (already exist) and
INSERT otherwise?
Right now I am doing it this way:
1. SELECT the record
2. If it exist, I UPDATE it
3. If it does not exit, I INSERT a new record
Could this be done in one query? I mean like
insert into table1 (fa,fb,qty) values (fa1,fb1,qty1) on duplicate key
update qty=qty+qty1
a primarykey or unique key must.
Shuming Wang
Apologies if this is a dumb question, but is it possible to write a single
query that either updates certain columns in a row, or adds an entirely new
row if there is none already?
I seem to be running into this a lot, and so far I've solved it by:
1) run UPDATE table SET x,y WHERE some row
2
seem to be running into this a lot, and so far I've solved it by:
1) run UPDATE table SET x,y WHERE some row
2) if rowsChanged == 0 then run the INSERT
It just feels like there must be a way to do this more efficiently.
Thanks,
Doug
--
MySQL General Mailing List
For list archives: http
is a MySQL extension to the SQL standard. It either inserts, or
deletes and inserts. For another MySQL extension to standard SQL — that
either inserts or updates — see Section 13.2.4.3, “INSERT ... ON DUPLICATE
KEY UPDATE Syntax”.
Note that unless the table has a PRIMARY KEY or UNIQUE index, using
REPLACE is a MySQL extension to the SQL standard. It either inserts, or
deletes and inserts. For another MySQL extension to standard SQL — that
either inserts or updates — see Section 13.2.4.3, “INSERT ... ON DUPLICATE
KEY UPDATE Syntax”.
Take note!!
If you're using triggers, foreign key
BEGIN
UPDATE myTable SET .
END;
END IF;
END;
Randall Price
Secure Enterprise Technology Initiatives
Microsoft Implementation Group
Virginia Tech Information Technology
-Original Message-
From: Douglas Pearson [mailto:[EMAIL PROTECTED]
Sent: Friday, April 13, 2007 2:14
Thanks Mogens. I was aware of REPLACE but it was the non-standard ON
DUPLICATE KEY UPDATE that I was looking for.
Thanks,
Doug
-Original Message-
From: Mogens Melander [mailto:[EMAIL PROTECTED]
Sent: Friday, April 13, 2007 2:28 AM
To: Douglas Pearson
Cc: [EMAIL PROTECTED]
Subject: Re
(logintime) from T2 for each
user. How do I do this? I tried variants of this:
update T1, T2 set last_login_time = max(logintime) where T1.userid =
T2.userid.
Thanks
Ravi.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com
I think you want a subquery. Something like
UPDATE t1 SET last_login_time = (SELECT MAX(logintime) FROM t2 WHERE
t1.userid = t2.userid);
would be a good start.
Regards,
Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032
860.674.8796 / FAX: 860.674.8341
When I run the query:
UPDATE InvHead I
JOIN (SELECT InvNo,Sum(Rate + CASE WHEN AttendingAcademy=1 THEN 30 ELSE 0
END) AS InvTot
FROM Participants P GROUP BY InvNo) AS PartSum ON
PartSum.InvNo=I.InvNo
SET I.Total=PartSum.InvTot
WHERE (I.InvoiceType='CL' OR I.InvoiceType='CSS
Don't know?
5.0.22-community-nt-log
Win XP Pro
InnoDB
Jesse
- Original Message -
From: sol beach
To: Jesse
Sent: Monday, April 02, 2007 4:22 PM
Subject: Re: UPDATE / not UPDATE??
Might this behavior be version dependent; which you neglected to provide.
Same for OS name
Subject: UPDATE / not UPDATE??
When I run the query:
UPDATE InvHead I
JOIN (SELECT InvNo,Sum(Rate + CASE WHEN AttendingAcademy=1
THEN 30 ELSE 0
END) AS InvTot
FROM Participants P GROUP BY InvNo) AS PartSum ON
PartSum.InvNo=I.InvNo
SET I.Total=PartSum.InvTot
WHERE (I.InvoiceType='CL
I have 2 tables and I need to update Table1 with the rows from table 2.
They have 15 columns that need updating (that are in both tables). Now I
could delete the old rows from table1, except there are around 1 million
rows, from a 35 million row table. This takes too long. I'd like to update
I run a SQL statement about UPDATE covering multiple tables, i feel that it is
too slowly.
SQL statement:
update b_bb,tempdb set b_bb.zrk1=tempdb.num
where
b_bb.dwdm=concat(tempdb.shengbm,tempdb.shibm,tempdb.xianbm,tempdb.xiangbm,tempdb.cunbm);
I modify the JOIN syntax like this:
update
AB
-Original Message-
From: mos [mailto:[EMAIL PROTECTED]
Sent: Friday, March 02, 2007 7:39 AM
To: mysql@lists.mysql.com
Subject: Best update strategy with MyISAM
I will have an application that will have 1000 20 row selects executed
every second. The application will also
on the
machine and InnoDb is too slow if the table doesn't fit into memory.
With MyISAM:
1) Will the updates block the Select statements from executing? If so, is
there a way around it? I don't want to stop the Select's from executing by
having them wait for an update lock to complete.
2) Is it better
--
Axel Schwenke, Senior Software Developer, MySQL AB
-Original Message-
From: mos [mailto:[EMAIL PROTECTED]
Sent: Friday, March 02, 2007 7:39 AM
To: mysql@lists.mysql.com
Subject: Best update strategy with MyISAM
I will have an application that will have 1000 20 row selects
the rating 2-3 times a month, it's not big deal, but
I would like to know what is correct solution: have a three queries,
e.g.:
mysql_query(
update suppliers
set rating='R'
where supp_id=1 or supp_id=5 or supp_id=8 or supp_id=23 or ... or
supp_id=1786);
mysql_query(
update suppliers
, $thislen - 1);
}
$query = update suppliers set rating='A' where supp_id IN
(${rating_list[A]});
... And so forth.
Regards,
Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032
860.674.8796 / FAX: 860.674.8341
-Original Message-
From: [EMAIL PROTECTED
Hi,
Yes it is possible to use sum with Update, subject to the constraint -table
to be updated must not present in the FROM clause of the select stmt. But in
your query, the table to be updated is present in the FROM clause. Hence
update doesn't support that and have to go for some procedures
2007/2/15, Manuel Vacelet [EMAIL PROTECTED]:
Hi all,
I'm facing a strange behaviour with an UPDATE statement.
I have a table like:
+-+--+
| item_id | rank |
+-+--+
|2812 |2 |
| 13050 |4 |
| 13051 |3 |
| 13052 |1 |
+-+--+
And I want
Hi Everyone
I have a question regarding SUM and Update.
is it possible to use SUM with Update ?
for example I have 3 tables
table_1:
idT1 Price
120
230
350
420
table_2:
idCust Total
Hi all,
I'm facing a strange behaviour with an UPDATE statement.
I have a table like:
+-+--+
| item_id | rank |
+-+--+
|2812 |2 |
| 13050 |4 |
| 13051 |3 |
| 13052 |1 |
+-+--+
And I want to switch items 2812 and 13052 rank (i.e
Found the source of my problem.
I had an update trigger connected to this table which was trying to
create a new entry in another table instead of updating an existing one!
There we go!
Simon
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http
something. The only condition I can think of off the top of my head
which might do that is if you have another unique key in your
structure and that is the one this error is complaining about.
On 2/12/07, Simon Giddings [EMAIL PROTECTED] wrote:
Good morning,
I issue an update statement containing
Good morning,
I issue an update statement containing a where clause on the primary
index, so as to update a single record. Howerver this is failing with
Duplicate entry '6' for key 1 -
update clients.calendarentry set Subject = 'presentation' where
idCalendarEntry = 6;
In the table
- Original Message -
From: Devi [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Monday, February 12, 2007 5:34 PM
Subject: Re: Update failing with error 1062
Hi MySQLeers,
How can I setup multiple daemons, One daemon for one database? So that
they can act independenly. What
Hi MySQLeers,
How can I setup multiple daemons, One daemon for one database? So that they
can act independenly. What might be the pitfalls over here?
In what situation one can opt for multiple daemons?
What about maximum_connections. Is it for all the server instances?
Thanks
DEVI. G
[EMAIL PROTECTED] wrote:
Good morning,
I issue an update statement containing a where clause on the primary
index, so as to update a single record. Howerver this is failing with
Duplicate entry '6' for key 1 -
update clients.calendarentry set Subject = 'presentation' where
idCalendarEntry = 6
I want to use a merge table so that I can direct all new INSERTs to a
new merge table and migrate old data off the system by having a
continually sliding window of underlying MyISAM tables.
The problem is that of I do INSERT ... ON DUPLCATE KEY UPDATE and
that value isn't in the leading table
Kevin Burton wrote:
I want to use a merge table so that I can direct all new INSERTs to a
new merge table and migrate old data off the system by having a
continually sliding window of underlying MyISAM tables.
The problem is that of I do INSERT ... ON DUPLCATE KEY UPDATE and
that value isn't
... ON DUPLCATE KEY UPDATE and
that value isn't in the leading table where all INSERTs go a *new* row
will be created.
Is there any way around this problem?
What about using partitioning in MySQl 5.1+? Would this work?
http://dev.mysql.com/doc/refman/5.1/en/partitioning.html
Cheers,
Jay
Hi,
Try this,
mysql update atable,btable set atable.b=atable.b+(select sum(b) from btable
where btable.a=atable.a) where atable.a=btable.a;
mysql select * from atable;
+--+--+
| a| b|
+--+--+
| 1| 10 |
| 2| 15 |
| 3| 23 |
| 4| 10
Dear listmembers
On mysql version 4.1.13 I execute a query of this type:
UPDATE a
LEFT JOIN b ON a.col = b.col
SET a.x = a.x + b.y
WHERE b.col IS NOT NULL;
I expect that column a.x is updated for every match in the join but this
is not the case. Table a is updated for the first match only
Hello,
I am trying to update two fields of a table that are a composed foreign
key to another table. These fields cant be updated with this kind of
warning:
Warning | 1292 | Truncated incorrect DOUBLE value: 'A05'
Both tables are InnoDB and I have tried with all types of constraints,
ON UPDATE
Posting you table difinitions and queries would be helpful.
Olexandr Melnyk,
http://omelnyk.net/
2007/2/8, Alicia Amadoz [EMAIL PROTECTED]:
Hello,
I am trying to update two fields of a table that are a composed foreign
key to another table. These fields cant
and then updating this field in the
referencing table. Once this field has been updated, then I perform an
update to the second field in the referencing table.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
I am new to mysql. I am trying to do a simple update query to update a
field based on the contents of another field in the same table.
Here is what I have.
update inventory_items set name = necklace where description like
%necklace%;
I am not sure what is wrong. select * from inventory_items
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: mysql
I need to run a query that will take the data from item_number field,
add -1.jpg to the end of it, and store it in image_location
I have tried update inventory_items set image_location = item_number + -1.jpg;
but that just places the item number into the field, without the text
in quotes.
How do
Try using CONCAT() ;
mysql update inventory_items set
image_location=concat(item_number,'-1.jpg');
Thanks
ViSolve DB Team.
- Original Message -
From: Jerry Jones [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Saturday, February 03, 2007 12:00 PM
Subject: Update queries
I need
On Saturday 20 January 2007 05:52, ViSolve DB Team wrote:
Hi
Update will never support group by clause, only supports group functions;
Try as:
Update teams t
inner join rider_team as rt on (rt.team_id=t.id)
inner join participants as p on (p.rider_id=rt.rider_id
Hi
Update will never support group by clause, only supports group functions;
Try as:
Update teams t
inner join rider_team as rt on (rt.team_id=t.id)
inner join participants as p on (p.rider_id=rt.rider_id)
inner join races as r on (r.id=p.race_id)
set
I concede to the MySQL engineer :-)
-Original Message-
From: Shawn Green [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 10, 2007 3:30 PM
To: Jonathan Langevin
Cc: Chris White; Richard Reina; mysql@lists.mysql.com
Subject: Re: Does Update allow for aliases?
Hi all,
Multi-table
I want to update new column in a table with data from other tables.
The following query give me the data:
select t.id,min(r.starttime)
from teams as t
inner join rider_team as rt on (rt.team_id=t.id)
inner join participants as p on (p.rider_id=rt.rider_id)
inner join races as r
The key part of the documentation for me was:
- Original Message -
From: Chris White [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Wednesday, January 10, 2007 12:55 PM
Subject: Multiple table updates (Was: Does Update allow for aliases)
Reading the noted previous thread, I
The key part of the UPDATE documentation for me was:
The table_references clause lists the tables involved in the join. Its syntax is
described in Section 13.2.7.1, JOIN Syntax.
Basically you can take almost any SELECT statement with JOINs and convert it to an UPDATE. There are certain
I am trying to update from one table to another but I get a syntax error when I
try:
UPDATE from maindb.orders o, altdb.orders ao SET o.price=ao.price WHERE
o.ID=a.ID;
If update does not support aliases, is there another way to do this query? I
am usin V3.23.54. Any help would
Richard Reina wrote:
I am trying to update from one table to another but I get a syntax error when I
try:
UPDATE from maindb.orders o, altdb.orders ao SET o.price=ao.price WHERE o.ID=a.ID;
First off, it'd be best if possible (I know some cases prevent it) to
upgrade your server
Hi Richard,
Richard Reina wrote:
I am trying to update from one table to another but I get a syntax error when I
try:
UPDATE from maindb.orders o, altdb.orders ao SET o.price=ao.price WHERE o.ID=a.ID;
If update does not support aliases, is there another way to do this query? I am usin
Reading the noted previous thread, I was curious as to updating multiple
tables. I read the MySQL docs, which mentions that you can do it:
Multiple-table syntax:
UPDATE [LOW_PRIORITY] [IGNORE] /|table_references|/
SET /|col_name1|/=/|expr1|/ [, /|col_name2|/=/|expr2|/ ...]
[WHERE
The proper syntax would need to be:
UPDATE maindb.orders o, altdb.orders ao SET o.price=ao.price WHERE
o.ID=a.ID;
The only problem is the existence of the from.
That being said, an UPDATE ... JOIN likely doesn't work under MySQL 3
-Original Message-
From: Chris White [mailto:[EMAIL
Langevin wrote:
The proper syntax would need to be:
UPDATE maindb.orders o, altdb.orders ao SET o.price=ao.price WHERE
o.ID=a.ID;
snip
The second table is aliased to 'ao' not 'a':
UPDATE maindb.orders o, altdb.orders ao SET o.price=ao.price
WHERE o.ID=ao.ID;
^^
Look here
Hi Reina,
Try like:
mysql UPDATE maindb o,altdb ao set o.price =ao.price where o.id=ao.id;
This will do good.
Thanks
ViSolve DB Team
- Original Message -
From: Richard Reina [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Wednesday, January 10, 2007 10:08 PM
Subject: Does
I have an ASP.NET app where I'm doing an update, and the user name that I'm
using has the access to do an update. When I execute this command, I get the
error, #42000Access denied; you need the SUPER privilege for this
operation. Following is my query:
UPDATE Families SET
LastName
Hi
Jesse wrote:
I have an ASP.NET app where I'm doing an update, and the user name
that I'm using has the access to do an update. When I execute this
command, I get the error, #42000Access denied; you need the SUPER
privilege for this operation. Following is my query:
UPDATE Families SET
Sounds like you have triggers on the table, see the DEFINER clause within
this section of the manual:
http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html
Triggers within 5.0 require the user (within the DEFINER clause, or
executing the statement against the table when using
Hi,
From your query, understood that you want to retain old qty and new qty;
result in another field.
Try with,
INSERT INTO TABLE1 (id,newqty) values (6,300) ON DUPLICATE KEY UPDATE
totqty=oldqty+newqty, oldqty=newqty;
Thanks,
ViSolve DB Team
- Original Message -
From: Ed Reed
I use On Duplicate Key Update a lot and I usually use it like this,
Insert Into tablename (myID, Qty)
Values (1034,15),
(6,13),
(5001,1),
(145,20) On Duplicate Key Update Qty=Values(Qty);
This works very well but now I'd like to do something a little
different. I'd like to have a query like
Sorry for the premature question. I think I figured it out.
On Duplicate Key Update Qty=Qty+Values(Qty);
I haven't tested it yet but it makes sense that it'll work.
Ed Reed [EMAIL PROTECTED] 1/5/07 2:40 PM
I use On Duplicate Key Update a lot and I usually use it like this,
Insert
Ed Reed wrote:
I use On Duplicate Key Update a lot and I usually use it like this,
Insert Into tablename (myID, Qty)
Values (1034,15),
(6,13),
(5001,1),
(145,20) On Duplicate Key Update Qty=Values(Qty);
This works very well but now I'd like to do something a little
different. I'd like to have
I've used the syntax, UPDATE ... LEFT JOIN a few times in the past, and
today I used it again for a new employer that I work for.
Several of my associates were unaware that the UPDATE ... LEFT JOIN
syntax is valid in MySQL. After I demonstrated that the query does
indeed work fine on our MySQL 5
Incorporated
195 Farmington Ave.
Farmington, CT 06032
860.674.8796 / FAX: 860.674.8341
-Original Message-
From: Jonathan Langevin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 03, 2007 4:13 PM
To: mysql@lists.mysql.com
Subject: Question regarding Update ... LEFT JOIN
I've used
; mysql@lists.mysql.com
Subject: RE: Question regarding Update ... LEFT JOIN
I hope it is locking both tables. Even if you aren't changing any fields
in
the right-hand column, you don't want anyone changing it under you. I
hope
that, if you aren't actually modifying the right-hand table, that MySQL
uses
Just a thought, if I were to JOIN or reference a SUBQUERY instead,
inside the UPDATE statement, would that lessen the length of time for a
SELECT lock? From what I understand, subqueries get temporarily cached
as a temp table, so theoretically it would be a way to avoid locks, no?
(or, reduce
Hi, I didn't find a way to know the time and date of the last update of
table, not the data but the table info itself.
Is this possible?
I want to use this info in order to show it in a web page.
Mysql 4.1
Apache
Myisam
Regards
Marcelo Fabiani
--
MySQL General Mailing List
For list
: Check the user privilege to access the database. If not grant it.
Thanks
ViSolve DB Team.
- Original Message -
From: Marcelo Fabiani [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Friday, December 22, 2006 6:21 AM
Subject: find date an time of a table update
Hi, I didn't find
I agree, you should just update it since the standard operation for
MYSQL is
to only apply updates if the value is changing.
http://dev.mysql.com/doc/refman/5.0/en/update.html
If you set a column to the value it currently has,
MySQL notices this and does not update it.
Ed
-Original
What is the best way to UPDATE a row only if values are different? We
have a mainframe extract that literally has 100,000 rows and am worried
about the performance of just running INSERTs each night.
Is there a simple comparison command or would you have to nest a SELECT
statement? Thank you
301 - 400 of 2309 matches
Mail list logo