Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 2. Retrieving Information from D... > Merging Column Output Using Concaten...

Merging Column Output Using Concatenation

You can merge the display of columns using concatenation. This allows you to create more friendly and meaningful output. For example, in the customers table, the first_name and last_name columns contain the customer name. In the previous examples, these columns were selected and displayed independently. Wouldn’t it be nice to merge the display of those columns together under one column heading? You can do this using the concatenation operator (| |), as shown in the following example:

SELECT first_name || ' ' || last_name AS "Customer Name"
FROM customers;

Customer Name
--------------------
John Brown
Cynthia Green
Steve White
Gail Black
Doreen Blue


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint