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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.