0

Here is what I want to do:

current table:

+----+-------------+
| id | data |
+----+-------------+
| 1 | cow cow2 |
| 2 | cat cat2 |
| 3 | cam cam2 |
| 4 | cal cal |
+----+-------------+

here is what I want

+----+-------------+
| id | data |
+----+-------------+
| 1 | cow a cow2 |
| 2 | cat a cat2 |
| 3 | cam a cam2 |
| 4 | cal a cal |
+----+-------------+

thats it! I just want to add one little word between 2 already existing in my databases tables and wonder how this can be done?

1
  • @EdT.: This posting is not on concat, but replace or something like that. Commented Mar 29, 2014 at 13:32

2 Answers 2

2

you can simply replace the space character with a space, the letter a and another space

UPDATE foo
SET data = REPLACE(data, ' ', ' a ');
Sign up to request clarification or add additional context in comments.

2 Comments

Hope for the data having a single space.
Hey, my misstade. The data do not have a single space always, sometimes it's 2 or 3. anyway i can decide for each run wich space i want to insert my new data? the first second or third etc.
0

Use the Replace function

    UPDATE tableName
   SET data = REPLACE(data, ' ', 'a')

1 Comment

Hey, my misstade. The data do not have a single space always, sometimes it's 2 or 3. anyway i can decide for each run wich space i want to insert my new data? the first second or third etc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.