: CREATE view v_row_col_notnull as select id, 'c1 'cn, c1 cv FROM t_col_row where c1 is not null union all select id, 'c2 'cn, c2 cv FROM t_col_row where c2 is not null union all select id, 'c3' cn, c3 cv FROM t_col_row where c3 is not null;
8. The following may be the oracle view frequently used by DBAs.
1. example: If hash_value: 3111103299 is known, query the SQL
Label:Query optimization methods and Gather_plan_statistics hint:after 10g we can use gather_plan_statistics hints to learn more about SQL execution statistics, using the following methods:If the Statistics_level parameter is set to all, or if the SQL executed uses gather_plan_statistics hint, after SQL executes, the V$sql_plan_statistics_ In the all view,
, there will be some wrong oracle concepts. Some people in oracle DBA training said that I would use SQL to query oracle data. DBA said that if you say this, you are afraid that oracle data may also have the opportunity to check e
Recently there is a monitoring project to collect database information, the original plan is to write a SQL script, each script put a query statement and then through the operating system layer SU to the Oracle user through Sqlpus execute this. sql, and then add to crontab timed execution. But this problem has a disadv
database system (dictionary tables) to get information about the table space, first use the client tools to connect to the database, these tools can be sqlplus character tool, TOAD, pl/sql, etc. After you connect to the database, execute the following query statement:
Select
A.A1 table space Name,
C.C2 type,
C.C3 District Management,
b.b2/1024/1024 table space size M,
(B.B2-A.A2)/1024/1024 has used M,
SUBS
multiple tables or classify and summarize the data in the tables. This requires complex advanced queries.
2. Table relationship
Relationship between multiple tables: Same as mysqThree table relationships: One-to-many | (many-to-one), many-to-many, one-to-one;
Integrity constraints of a link: entity integrity, referential integrity, and defined integrity. Entity integrity and reference integrity must be met.Entity integrity: Specifies the FIELD | attribute constraints.Integrity of reference: Con
bosses of those groups, because they know nothing about Oracle databases.1.6 How to use the alias of a column in an SQL statementIn order to let the bosses understand, you do not hesitate to change the query in example 1-13 again, this time, you use the alias of the column, issued an example 1-14 of the SQL statementE
still five minutes of problems. In 9i, flashback query based on time is very easy to have a large error, but fortunately, 10g has improved this. in fact, the main reason is that it takes 5 minutes for the 9i scn to synchronize with the time. That is to say, if the newly inserted data is less than 5 minutes, flashback query will be made based on the time. No data can be found.
1. Find the relationship betwe
will use the memory of the sort_area_size. The optimization of this memory is also very important.4. The Order by statement is added to the index column, preferably the primary key PK. SELECT Dept_code from DEPT ORDER by Dept_type (inefficient)
5. Avoid using resource-intensive operations:SQL statements with distinct,union,minus,intersect start the SQL engine to perform the resource-intensive sorting (sort) function. Distinct requires a sort operati
:-- Query the default temporary tablespaceSelect * from database_properties where property_name = 'default _ TEMP_TABLESPACE ';-- Modify the default temporary tablespaceAlter database default temporary tablespace temp1;All users' default temporary tablespace will be switched to the new temporary tablespace:Select username, temporary_tablespace, default _ from dba_users;-- Change the temporary tablespace of a user:Alter user scott temporary tablespace
Limit cannot be used for Oracle paging query.1. Select * From table_name where rownum> begin and rownum 2. SQL = "select * from table"Con. preparecall ("select * from (select. *, rownum R from ("+ SQL +") A where rownum * Intpagesize );Today I want to query all the table nam
followed only by the join condition, and the conditions for the intermediate table restrictions are written in the WHERE clause.Statement 9: Full outer join (outer join).Select On c.id=o.customer_id;Note: MySQL does not support all-out connections, and the notation given here is for Oracle and DB2. However, it is possible to obtain the query result of the full outer join through the left outer and right ou
using Oracle parallel queries to play the power of multiple CPUs2006-07-05 07:00 Author: Source: BLOG Editor: Ark the installation of more CPUs in a separate server is a current trend. With symmetric multi-processor (SMP), it is not surprising that an Oracle server has 8, 16 or 32 CPUs and several gigabytes of RAM.
Oracle has been following the pace of hardware
This article mainly introduces how to connect php to the oracle database and query data. it analyzes in detail how to use php to operate the oracle database in the form of an instance, which has some reference value, for more information about how to connect php to the oracle database and
How should I query the user session information in the Oracle database? The following describes in detail how to query Oracle user session information.AD:Oracle user sessions are expected to be well understood. The following describes how to query
Oracle SQL uses with recursive analysis (for example) and oracle Recursion
The WITH recursion provided by Oracle is not just a repetition of tree-like queries. In fact, recursive WITH statements can provide more flexible tree-like Query functions.
The following describes th
to improve the efficiency of SQL query how to write the precedence of where statement conditionshttp://blog.csdn.net/sforiz/article/details/5345359We have to do not only write SQL, but also to write good performance of SQL statements.(1) Select the most efficient table name order (valid only in the rule-based optimizer
Oracle Complex Query
Data Group,
Grouping FunctionsMax, Min, AVG, sum, count
Query the name of the person with the highest salary
Select ename from EMP where sal = (select max (SAL) from EMP );
Salary increases by 10% for all employees lower than the average salary
Update EMP set sal = (select AVT (SAL) from EMP) * 10% where Sal
Grout by and having
Groupt
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.