Concatenating Fields

To demonstrate working with calculated fields, let's start with a simple example—the mailing address.

The Vendors table contains vendor name and address information. Imagine that you are sending out a mailing to all your vendors and that you are printing labels using a report you have created. The label report requires three lines of text—the vendor name and two address lines.

The SELECT statement that returns all the vendor names is simple enough, but how would you create the second address line? The label application wants a single value, and the data in the table is stored in three columns: vend_city, vend_state, and vend_zip.

Concatenate Joining values together (by appending them to each other) to form a single long value. ...

Get Sams Teach Yourself SQL in 10 Minutes, 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.