Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Update and Replace
07-30-2011, 05:00 PM #1
- Join Date
- Jun 2009
- Thanked 0 Times in 0 Posts
Update and Replace
Would I be right in saying that the following update statement will replace 1 with 01 and 14 with 014.
I only want it to replace 1 with 01 - how do I achieve this?
update bookings set eventMonth = replace(eventMonth, '1', '01')
07-30-2011, 09:44 PM #2
Ummm...it depends on what kind of field eventMonth is.
If eventMonth is an integer, for example, either that code will do nothing or it will cause an error.
But if eventMonth is a text field of some kind, you are correct.
But why not find out?
What do you get?Code:SELECT replace(eventMonth,'1','01') FROM bookings