Databases Reporting with SQL Working with Text Concatenating Text

Cosmin Iuga
Cosmin Iuga
2,058 Points

Hello again.

Does this one make more sense? SELECT street||", "|| city|| ", "|| state||", "|| zip||". "|| country AS "address" FROM addresses;

Thank you again.

3 Answers

Ian Hawe
PRO
Ian Hawe
Pro Student 8,494 Points

Hi Hopefully this makes things clear,

SELECT is usually followed by your column names

AS is used to create a name for that column in the results

FROM is used to select from a table.

That being said if the table name is 'addresses' and the column names are 'street||"' '|| city|| "' '"|| state||"' and '"|| zip||". "||' then you're fine. If its not try to find the column names in the table 'address' to present your results. Here is an example of what I think you might be looking for:
SELECT street AS Street, city AS City, state AS State, zip AS Zip FROM addresses;

Tommy Gebru
Tommy Gebru
28,597 Points

Just a friendly reminder Cosmin, try not to juggle multiple conversations in the Community Forum :wink:

If you don't get an answer immediately try reading and searching for the same questions through the search bar :eyes: or the filter by subject dropdown :thumbsup: