Databases Reporting with SQL Working with Text Concatenating Text

Shreemangal Sethi
Shreemangal Sethi
Full Stack JavaScript Techdegree Student 7,506 Points

Please help me with the syntax for this SQL statement.

I want to concatenate street, city, state, zip and country as Street, City, State Zip. Country alias it to "address"

SELECT street AS "Steet" || ", " || city AS "City" || ", " || state AS "State" || " " || zip AS "Zip" || "." || country AS "Country" AS "address" FROM addresses;

2 Answers

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 50,933 Points

You don't need to alias each field. The only alias you need is at the end with AS "address". In addition you need a space after the period between zip and country.