Databases Reporting with SQL Working with Text Concatenating Text

Jessica Schteiden
Jessica Schteiden
3,254 Points

Issue with Concatenation Function

Not sure how I am able to incorporate angle brackets around the email alias. Tried a few different things out but am getting stuck.

1 Answer

KRIS NIKOLAISEN
KRIS NIKOLAISEN
54,293 Points

email isn't an alias. Nor is there a concatenation function in SQLite. Use the concatenation operator. Just make sure the angle brackets and any spaces are enclosed in quotes and email isn't. For example

SELECT '<' || email || '>' AS formatted_email FROM patrons;

will retrieve:

<andrew@teamtreehouse.com>

as formatted_email for a record with andrew@teamtreehouse.com in the email field.