Databases Reporting with SQL Working with Text Concatenating Text

Taylor Han
Taylor Han
2,405 Points

SQL concatenation

SELECT first_name || " " || last_name || email AS "to_field" FROM patrons;

This is the portion I've written to generate the concatenated text ( I think I attached the code to this post) but it keeps returning that the email info is not being returned in the right format. Any help is appreciated. Thanks!

1 Answer

Taylor Han
Taylor Han
2,405 Points

Found the information on another question, I did not include the || < || and || >|| for the email format, I thought it was already formatted like that in the database.

So it needed to be:

SELECT first_name || " " || last_name || " <" || email || ">" AS "to_field" FROM patrons:

Nathan Zelaya
Nathan Zelaya
Pro Student 4,338 Points

Those two angle brackets were all I needed. I've been working on this challenge for almost an hour, and I could not figure out what I was doing wrong for the life of me! This makes perfect sense! I see where my error lied.