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