How do I update a single character, in table 'units', column 'status' (varchar), at a specific position (varies)?
UPDATE units SET status = SELECT INSERT(status, 3, 1, '2') WHERE id='1'
When running this (in PHP) This give me an error 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version....'
Rather than the desired
Before '00000'
After '00200'
There are lots of examples of the SELECT INSERT function but all with a predefined string, rather than using an existing entry.
Thank you for your consideration.
CodePudding user response:
Just remove the SELECT before INSERT(...
UPDATE units SET status = INSERT(status, 3, 1, '2') WHERE id='1'
