Selecting columns in Oracle query to SQL query

Source: Internet
Author: User
Tags sql server query oracle rownum

How does the column selection differ when Oracle queries are converted to SQL queries? The following describes how to select columns from Oracle query to SQL query. We hope that you can have a deeper understanding of Oracle query.

When converting an Oracle query to an SQL Server, you must be careful about some issues that are not easy to notice. We know that T-SQL is the language engine of SQL Server, while Oracle's language engine is PLSQL. Both query languages have extended the ANSI SQL-92 standard to provide additional support. Almost all applications you create use these complementary features. This article describes the most common and non-standard Oracle extensions. It also describes how to convert these extensions for use in the SQL Server environment.

Column Selection

When PLSQL is used to perform data queries, the FROM clause is required, which is the same as that of SQL Server. The SELECT statement must SELECT the target data table. In the Oracle database, there is a special table DUAL. DUAL

Oracle is created together with the data dictionary. All users can access the table with the name DUAL. There is only one DUMMY column in this table, which is defined as VARCHAR21) type with a row value of X.

Selecting data from the DUAL table is often used to calculate the constant expression through the SELECT statement. Because DUAL only has one row of data, the constant is returned only once.

The DUAL query in Oracle is as follows:

SELECT 'x' FROM dual

The equivalent SQL Server Query looks like this:

SELECT 'x'

Connection

Oracle uses | as the connector, while SQL Server uses the plus sign: +.

The Oracle query is as follows:

Select 'name' | 'last name'

From tableName

The corresponding SQL Server query is as follows:

Select 'name' + 'last name'


 

Implementation of parallel query of one column in oracle

Use of oracle rownum statements

Introduction to Oracle index rules

Step 5: Create an oracle full-text index

How to create an Oracle Index

Related Article

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.