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