Database alias as Difference

Source: Internet
Author: User
Tags aliases

The alias column can be referenced in an external query as an inline view of the query that takes the alias. Why did you do it? The WHERE clause is processed before the Select, so that salary and commission do not exist until the WHERE clause of the solve question query is processed, and the alias does not take effect until the WHERE clause has been processed. However, the FROM clause is processed before the where. When the original query is placed in the FROM clause, the query results are generated before the outermost where clause, and before the outermost where clause "sees" the alias.

Oracle connection operator, connection string, | |  Double vertical bar, use double quotation marks on column aliases, use double quotation marks on column aliases to enter and execute queries using column aliases with special characters: 1.SELECT ename as "Name", sal*12+5000 as "annual salary (plus year-end award)" from EMP;  1.SELECT ename as "Name", sal*12+5000 as "annual salary (plus year-end award)" from EMP; The results shown are:
1.Name Annual salary (plus year-end award) 2. -------------------------------------------3. SMITH 14600 4. ALLEN 24200 1.Name Annual salary (plus year-end award) 2. -------------------------------------------3. SMITH 14600 4. ALLEN 24200 Description: Where the alias "Name" has the case difference, the alias "annual salary (plus Year award)" appears in parentheses, is a special symbol, so you need to use double quotation marks to the alias.
The JOIN operator SQL statement can use computed columns that contain numeric operations, which show that the results are also numeric. We can also use a computed column of a character type by using a JOIN operation in the query. The join operator is a double vertical bar "| |". A JOIN operation allows you to concatenate two strings together. Use the join operation in the query. Enter and execute query: 1.SELECT ename| | Job as "Employee and Job list" from EMP; 1.SELECT ename| | Job as "Employee and Job list" from EMP; The output is: 1. Employee and Job Title table 2. -------------------3. Smithclerk 4. Allensalesman 1. Employee and Job Title table 2. -------------------3. Smithclerk 4. Allensalesman Description: In this example, the employee name and title column are concatenated into a column display. You can use constant characters and dates in a query to indicate a fixed string or a fixed date. The character and date constants need to be enclosed in single quotation marks. The next training is an improvement on the previous training. Use string constants in queries. Enter and execute query: 1.SELECT ename| | ' Is ' | | Job as "Employee and Job list" from EMP; 1.SELECT ename| | ' Is ' | | Job as "Employee and Job list" from EMP; The output is: 1. Employee and Job Title table 2. -----------------------3. SMITH is Clerk 4. ALLEN is salesman 1. Employee and Title Table 2. -----------------------3. SMITH is Clerk 4. ALLEN is salesman Description: This exercise connects the employee name, the string constant, is, and the 3 parts of the employee title.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.