Okay, let's begin. First, we'll need a new operator:
||. These two vertical bars are the concatenation operator, i.e., they join two or more text values (or strings, which is another name for text). If you write the following:
SELECT first_name || last_name
The result for
first_name = 'Kate' and
last_name = 'Gordon' will be
KateGordon, all in a single column. Quite simple, right?
Of course we want the first and last name separated with a space. Here's how you do it:
SELECT first_name || ' ' || last_name
Note that you use apostrophes for specific constant text values (a space in our example:
' '), but you don't use apostrophes for column names (
last_name). The operator
|| can be used as many times as you need in a single query.