Databases Reporting with SQL Working with Text Concatenating Text

Shreemangal Sethi
Shreemangal Sethi
8,386 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
KRIS NIKOLAISEN
53,362 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.