|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
What to use, REPLACE ?
Ok,
here is what I created: Code:
INSERT INTO test VALUES (1,'M:I:B:AA'); INSERT INTO test VALUES (2,'M:I:B:BB'); INSERT INTO test VALUES (3,'M:I:B:CC'); INSERT INTO test VALUES (4,'M:I:B:DD'); INSERT INTO test VALUES (5,'M:I:B:EE'); INSERT INTO test VALUES (6,'M:I:B:FF'); INSERT INTO test VALUES (7,'M:I:B:GG'); INSERT INTO test VALUES (8,'M:I:B:HH'); ..... The smiley face shouldn't be there in line 4, obviously, it should be : D (without the space). What I want to do is take out the 5th and 6th characters in all rows in the second column( e.g. B: ) and leave the rest of the data alone. I would like to replace the specific positions(5th and 6th) as I do not know if B: would come up again. I have tried using various replace statement with no luck. Am I using the right statement? How would I do this? TIA |
|
#2
|
|||
|
|||
|
RE: What to use, REPLACE ?
Code:
UPDATE test SET column_name=INSERT(column_name, 5, 2, '') For more info, see MySQL documentation. |
|
#3
|
|||
|
|||
|
RE: What to use, REPLACE ?
And be sure to run it only once
|
|
#4
|
|||
|
|||
|
RE: What to use, REPLACE ?
Thanks,
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > What to use, REPLACE ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|