Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAdrian Patrascu
15,279 PointsREPLACE does not work for me
Has anyone tried the steps detailed in the challenge with the replace statement? Does it work for you? I have tried: SELECT email AS obfuscated_email FROM customers WHERE REPLACE(email,"@","<at>"); and it does not work...
Thank you for any input!
Adrian
3 Answers
Cena Mayo
55,236 PointsHi Adrian,
I've struggled a bit with the order of syntax in this course, but this is what worked for me in this challenge:
SELECT REPLACE(email, "@", "<at>") as obfuscated_email FROM customers;
Hope that helps!
Adrian Patrascu
15,279 PointsHi Cena,
Thank you for your help, it works this way! Very good note that indeed it was a struggle.
Thank you, Adrian
Charlie Harcourt
8,046 Points@sulaiman abouabdah It only replaced the @ part because that's the first value which was being replaced and the second value of <at> was its replacement. You don't need to specify like %@% just put in a REPLACE() function with the column you want changing and the value inside the column you want to change and the replacement value that it will be exchanged with.
:)
sulaiman abouabdah
5,314 Pointssulaiman abouabdah
5,314 Pointshow come it replaced only the @ part from the whole email?. shouldn't you specify %@% in order for it to understand?