Single-line functions-character Functions
Although each database supports SQL statements, each database also has operation functions supported by each database. These are single-row functions. If you want to develop a database, in addition to SQL,
1. Select the most efficient table name order (valid only in the Rule-based optimizer)
The SQL Server parser processes the table names in the FROM clause in Right-to-left order, therefore, the last table in the FROM clause (driving table) is
The first step is to establish an appropriate index. SQL does not add a function in the index field to ensure that the cable is effective. If the composite index is noted in the Order of SQL. If an index is already present, it is recommended that
Sometimes when we show the data in the table, we need to display the rows into columns, as in the following form:The original table structure is shown below:---------------------------Product Name Sales Quarter---------------------------Cheese 50
1. Select the most efficient table name order (valid only in the rule-based optimizer ) The parser for SQL Server processes the table names in the FROM clause in a right-to-left order, so the table that is written in the FROM clause (the underlying
The DECODE function is Oracle PL/SQL is one of the most powerful functions, and only Oracle SQL provides this function, and the SQL implementations of other database vendors do not yet have this function. What is the use of decode? Let's first
SQL Optimization Tips (1):Connection order in the WHERE clause: Oracle parses the WHERE clause in a bottom-up order, and according to this principle, the connections between tables must be written before other where conditions, those that can filter
Struggled for several nights debugging procedures, wrote several blog, and finally set up a mybatis configuration extension mechanism. While it is important to extend the mechanism, it is at least less inspiring if there are no truly useful
1. Understand the Implementation plan1-1. What is the execution planWhen an Oracle database executes an SQL statement, the Oracle optimizer determines the execution path of the SQL statement according to certain rules. To ensure that SQL statements
Select the most efficient table name orderThe Oracle parser processes the table names in the FROM clause in a right-to-left order, and the FROM clause is written in the final table (the underlying table, driving tables) will be processed first, and
In most cases, Oracle uses index t to traverse tables more quickly, and the optimizer improves performance primarily based on defined indexes.However, if the SQL code written in the WHERE clause of the SQL statement is not reasonable, it will cause
Oracle Common Functions--trunc,to_date,to_char,to_number, SUBSTR,REPLACE,NVL, Trim,wm_concat,upper, Lower,length,add_months ( sysdate,1)View Oracle Version: SELECT * from V$version First, trunc function1, TRUNC (for dates) The date value that the
Where can I start learning about Oracle? Here, I will take you to the door of Oracle. One chapter a day, seven days of entry is not a dream.
1. SQL language Overview
1.1 SQL language classification
Data Definition Language (DDL)
Used to CREATE,
In Oracle, you can use the decode function to convert rows to columns. For example, if you have A student table named A: IDNAMESUBJECTSCORE1 Zhang San Language 902 Zhang San mathematics 803 Li Si.
In Oracle, you can use the decode function to
Document directory
Nvl
Decode Function
Decode is an exclusive function provided by Oracle. It is a powerful function. Although it is not an SQLStandard, but very useful for performance. Up to now, other database vendors have not yet provided
7.Reduce the number of database accesses
When each SQL statement is executed, ORACLE performs a lot of internal work: parsing SQL statements, estimating index utilization, binding variables, and reading data blocks. it can be seen that reducing the
Oracle provides a number of logical judgment functions that can be used in queries. 1, testing for null values-NVL function function prototype: NVL (testvalue,substitutevalue) common usage is Select max (score) from SC Where name= '
The Oracle decode function, regardless of whether the result of the query satisfies ' PRIMARY ', is executed by the SELECT statement in the parameter, and you know by looking at the execution planSet Autotrace traceonlyselect decode(database_role
in Oracle, case and then and decode usage one. Case... then syntax: – Writing one: CaseWhen value 1 then return value 1 when value 2 then return value 2ElseDefault Value – two: CaseWhen condition 1 then return value 1 when condition 2 then return
1.oracle OptimizerThe goal of optimization is divided into 4 categories:Choose (optional)Rule (rules-based)First rows (line one)All rows (all rows)Description: Describe the execution plan for SQLObject owner: Objects SchemaObject Name: Objects
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.