This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have table with following format StoreID | ItemID | ItemName | Qty . StoreID and ItemID are Pkeys.
Im trying to execute mysql query and insert StoreID ='ST1 ' ItemID ='IT1' ItemName='IT' Qty=1000
But here i want to insert the record if not exists, if exists update the Qty = Qty+ 100.
I tried using mysql Replace into and Duplicate key update. It does what i want to do, except Qty not increasing.
Both queries below set Qty to 0 when execute first time. As i can understand thats because there is no duplicate entry at the first time.
What i want to do is add the record if not exists with given qty and update only qty each time it execute afterwards
Joined: Nov 25, 2012
Hi. I got the solution already.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: MySQL Replace and DUPLICATE KEY not giving sum of column value