0

I have about 10000 rows in SQL table, and I need to add a prefix before each value of user column.

Example: I have value names like John, Smith, and so on, and I need to set QA-John, QA-Smith, and so on.

Is there an SQL function that can do it automatically or only can be done it one by one?

3 Answers 3

2

If I haven't misunderstood, this is what You're asking..

Update Table set name="QA-"+name
Sign up to request clarification or add additional context in comments.

1 Comment

Hi. Thanks but does not work changes all names (column name) to 0
0
update your_table_name
set 
product = 'QA-'||column_name 

3 Comments

Hi. Thanks but does not work changes all names (column name) to 0
@jose Silva it should work,please let me know which database you are using?
My database is set in phpMyadmin from wamp. Table name is profiles and column name is seller, where I have all the namesthat I need to add the prfix QA- before each value. I tried your sugestion but changes all the values to 0
0

I got it.

UPDATE my table SET column_name = CONCAT('prefix', column_name)

Comments

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.