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

Databases

Elizabeth guardado
Elizabeth guardado
2,865 Points

How to concatenate first name, last name and email?

How to concatenate first name, last name and email, with email having the "<>" around it Andrew.Chalkley@teamtreehouse.com I know that you have to write SELECT first_name||" "|| last_name||" "|| email but not sure how to add the < > to the email.

2 Answers

Steven Parker
Steven Parker
231,248 Points

Put those characters into literal strings to concatenate them with the email.

Just like you have spaces in strings to separate your names, you can put symbols in strings (with or without extra spaces as needed) and concatenate them with your columns also.

vs Vs
vs Vs
1,925 Points

SELECT first_name || " "|| last_name || " "|| "<" || email || ">" AS To_field FROM patrons;

To_field Andrew Chalkley andrew@teamtreehouse.com Dave McFarland dave@teamtreehouse.com Alena Holligan alena@teamtreehouse.com Michael Poley michael@teamtreehouse.com