Mysql update or insert
How do I update a single character, in table ' units ', column ' status ' varchar , at a specific position varies? Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked yesterday. Active yesterday. Viewed 18 times. Thank you for your consideration.
Improve this question. Shaedo Shaedo 3 3 silver badges 9 9 bronze badges. Restrictions on XA Transactions. Replication Statements.
Functions which Configure the Source List. Function which Configures Group Replication Primary. Functions which Configure the Group Replication Mode. Compound Statement Syntax. Variables in Stored Programs. Local Variable Scope and Resolution. Flow Control Statements. Restrictions on Server-Side Cursors. Restrictions on Condition Handling. Database Administration Statements. Account Management Statements. Resource Group Management Statements. Table Maintenance Statements.
Component, Plugin, and Loadable Function Statements. Other Administrative Statements. Community Bot 1 1 1 silver badge. Fantastic, managed to get that working however, if I only want it to update IF the date is newer then the existing one, what would need to be added? And if it isn't newer, leave the date as it is? And change only quantity?
Or leave both unaltered so do nothing at all in that case? Hi ypercude, yeah if the date isn't any newer then leave both unaltered — roadkill Then this edited version should work. Have come across something interesting, when I used a small amount of values it works fine, however on large amounts the quantity is updated even if the date is equal the last date used — roadkill Show 6 more comments. But that would work only with a unique index on Thanks for the reply, another useful answer, however if i wanted to add in addition to this that the quantity only be updated if the date is newer then the current one in the table?
As I'm parsing an XML file so some of the data is re-read — roadkill I would say you'd have to go for a stored procedure. Or manage that in the parsing of your xml file, before going to database Thanks for the quick reply. The XML I can't change as it is provided by a 3rd party so when you say a stored procedure what exactly do you mean? Anyway, a stored procedure is Show 2 more comments. Sign up or log in Sign up using Google.
Sign up using Facebook.
0コメント