How to choose between Oracle query and SQL query

Source: Internet
Author: User
Tags truncated oracle rownum

When converting Oracle queries to SQL queries, you need to pay attention to a lot of issues. The following gives you a detailed analysis of the number trade-offs in converting Oracle queries to SQL queries for your reference.

Number trade-offs

Oracle Database has a TRUNC function, which returns n digits of the m-bit decimal number. If m is omitted, n is 0 digits. The m value can be negative, indicating that the m digit on the left of the decimal point is truncated.

In SQL Server, you can use Round or Floor.

Oracle query:

SELECT TRUNC15.79, 1) "Truncate" from dual;

The following are SQL Server versions of similar queries:

SELECT ROUND15.79, 0) rounded,

ROUND15.79, 0, 1) truncated

SELECT FLOORROUND15.79, 0 )),

FLOORROUND15.79, 0, 1 ))

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.

ANSI SQL-92 standards are extended to provide additional support. Almost all applications you create use these complementary features. This article describes the most common and non-standard Oracle extensions.

Convert these extensions for use in the SQL Server environment.

Implementation of parallel query of one column in oracle

Use of oracle rownum statements

Oracle paging query statements

Oracle index type

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.