Tomislav Mladenovski Tomislav Mladenovski - 1 year ago 97
SQL Question

SQL Insert/update field with text before a character

I am using MySql and one of my tables, User_tb, has a column, user_email, where I store users' email addresses. I am relatively new to SQL, but I need to insert 'Sponsored' before the @ from the email address.

Example, => .

All my research points me to using substr however I am not exactly sure how to actually executed on it. Any help is appreciated :)

Answer Source
update User_tb set user_email = replace(user_email, '@', 'Sponsored@')

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download