While SQL allows us to manipulate numeric values with mathematical operators, we can also do some degree of character string manipulation with our statements. Earlier in the chapter, we used the DUAL
table to display string literals that were enclosed in single quotes. We can use concatenation to append one or more string literals with values from a table. There are actually two ways we can concatenate values in Oracle, but, in this section, we examine the concatenation operator "double-pipe" or (||
). The pipe symbol is invoked on most keyboards using Shift + \ (backslash). We use two of these pipe symbols or "double pipe" to concatenate values in SQL. A basic example of concatenation using the dual table is shown in the following example:
You can see that the first string, 'I Love ', is concatenated with the second, 'Companylink', and displayed together as 'I Love Companylink'. It is important to notice two things in this statement, aside from the...