Macromedia Dreamweaver 8 UNLEASHED [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Macromedia Dreamweaver 8 UNLEASHED [Electronic resources] - نسخه متنی

Zak Ruvalcaba

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید

Expressions


If you are the least bit familiar with programming languages, you know that

expressions are anything that, when calculated, result in a value. For instance, 1 + 1 = 2 is an example of an expression. Expressions in SQL work similarly. Consider the following data that could appear in the Employees table:

EmployeeID

FirstName

LastName

1

Ada

Spada

2

Agnes

Senga

3

Cammy

Franklin

4

Dave

Terry

5

Ferris

Wheel

You could use a simple SELECT statement to display the information exactly as it appears in the preceding table, or you could write an expression that appends the FirstName and LastName fields together. The query would look like this:


SELECT EmployeeID, FirstName & LastName AS Name
FROM Employees

Notice the & operator. The & operator is used to concatenate, or join, two fields into one virtual field using the AS keyword. The results would display as follows:

EmployeeID

Name

1

AdaSpada

2

AgnesSenga

3

CammyFranklin

4

DaveTerry

5

FerrisWheel

Notice that there is no space between the first and last names. To add a space, you need to add a literal string value as follows:


SELECT EmployeeID, FirstName & ' ' & LastName AS Name
FROM Employees

NOTE

You might have noticed that we've been using single quotes in every SQL statement. The reason for this is simple: When you construct your SQL statements in Dreamweaver, the server-side language encloses the entire statement in double quotes. For the statement to be valid, strings within a SQL statement must be enclosed within single quotes.

Adding the space results in a gap between the first and last names as follows:

EmployeeID

Name

1

Ada Spada

2

Agnes Senga

3

Cammy Franklin

4

Dave Terry

5

Ferris Wheel

/ 236