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 trial

Business

Ryan Aves
Ryan Aves
2,203 Points

When replacing "@" with "<at>" for email addresses in the customers table, what is wrong with my SELECT statement here?

My code:

SELECT REPLACE(email, "@", "<at>") AS obfuscated_email FROM customers WHERE REPLACE(email, "@", "<at>") = "<at>";

1 Answer

Steven Parker
Steven Parker
231,269 Points

I'd need to take a look at the task instructions to be sure, but this challenge probably does not require a WHERE clause.

And even if it did, the expression shown here would only be true when the "email" field contained only one "@" character and nothing else. That's probably not what you want.

Ryan Aves
Ryan Aves
2,203 Points

Hi Steven,

Thanks for replying - I managed to figure out my mistake! It turns out that my latter portion of the command (...WHERE REPLACE(email, "@", "<at>") = "<at>"') was not needed. I removed that section from my statement and it passed!