MySQL Forums
Forum List  »  Stored Procedures

Re: Table Not Updating
Posted by: Russel James
Date: April 27, 2016 12:44PM

Found the problem, my sql was updating field with 'F' when it should have been 'T', so it was updating all the time.

However, Im still finding the cursor much more faster. It takes around 3.45 secs using the cursor where as the same in a joined SQL statement takes around 201 seconds !!!


Here is the SQL I tried it with.

update customers c
join salesledger s
on c.customerid=s.customerid
and s.duedate < curdate()
and s.balance <> 0
set c.hasoverdueBalance = "T"


Customers has around 2000 rows. SalesLedger 145,000 rows.

Options: ReplyQuote


Subject
Views
Written By
Posted
2784
April 27, 2016 07:22AM
748
April 27, 2016 08:15AM
931
April 27, 2016 11:56AM
818
April 27, 2016 12:27PM
Re: Table Not Updating
896
April 27, 2016 12:44PM
892
April 27, 2016 01:35PM
912
April 27, 2016 01:51PM
787
April 27, 2016 01:56PM
969
April 27, 2016 02:29PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.