Types of Expressions

You will generally use the following three types of expressions when working with SQL statements.

CONCATENATIONCombining two or more character columns or literals into a single character string
MATHEMATICALAdding, subtracting, multiplying, and dividing numeric columns or literals
DATE AND TIME ARITHMETICApplying addition or subtraction to dates and times

Concatenation

The SQL Standard defines two sequential vertical bars as the concatenation operator. You can concatenate two character items by placing a single item on either side of the concatenation operator. The result is a single string of characters that is a combination of both items. Figure 5-5 shows the syntax diagram for the concatenation expression.

Figure 5-5. ...

Get SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.