0

I have a email column and each row has different number of email. I want to add same email end of to each row. For example;

[email protected];[email protected]
[email protected]
[email protected];[email protected];[email protected]

. . . What I want is;

[email protected];[email protected];[email protected]
[email protected];[email protected]
[email protected];[email protected];[email protected];[email protected]

how can I add ?

1
  • 2
    Never, ever store data as semicolon separated items. It will only cause you lots of trouble. Commented Sep 3, 2021 at 13:26

2 Answers 2

1

You will have to add your own table and column names but it sounds like a simple update

update tablename set column = column + ';[email protected]'

If you only want certain rows updated then add a:

where column like '%search condition%'
Sign up to request clarification or add additional context in comments.

1 Comment

Product specific answer to a question with no dbms specified. At least tell us which dbms this is for.
1

You didn't provide any information about database (MySQL, SQL Server, etc.). My solution is for SQL Server

update [tablename] set [column] = concat([column] + ';', '[email protected]')

Why using concat and "+"? Beacause if your table has record with column set to null then operation column + ';' returns also null. After that concat null with string give you that string so you avoid placing unnecesery semicolon at the begining in this case. If column in row has no null in column then column + ';' will add semicolon before your new email address.

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.