Tomislav Mladenovski Tomislav Mladenovski - 4 months ago 4
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 :)

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