20.07.2013 Views

Beginning SQL

Beginning SQL

Beginning SQL

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The preceding <strong>SQL</strong> returns the following results:<br />

FullName<br />

Katie Smith<br />

Susie Simons<br />

John Jackson<br />

Steve Gee<br />

John Jones<br />

Jenny Jones<br />

Jack Johnson<br />

Seymour Botts<br />

Jamie Hills<br />

Stuart Dales<br />

William Doors<br />

Doris Night<br />

Notice that not only can you join columns, but you can also join text. In the preceding example, you<br />

added a space between the first name and last name to make it more readable; otherwise, results would<br />

have been KatieSmith, SandraTell, and so on. When you join columns, you can add whatever text you<br />

wish. Consider the following query:<br />

SELECT ‘First name is ‘ + FirstName + ‘, last name is ‘ + LastName FullName<br />

FROM MemberDetails;<br />

The preceding code produces these results:<br />

FullName<br />

First name is Katie<br />

First name is Susie<br />

First name is John<br />

First name is Steve<br />

First name is John<br />

First name is Jenny<br />

First name is Jack<br />

First name is Seymour<br />

First name is Jamie<br />

Extracting Information<br />

Table continued on following page<br />

83

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!