Select * from
(Select a. *, rownum R
From
-- The SQL here can be changed to the SQL statement you actually want to parse.
(Select * from articles
Order by pubtime DESC
)
-- Use the set returned by the preceding SQL statement, and use rownum
Oracle_base: Specifies the top-level directory of Oracle software.
Example:/u01/APP/Oracle
ORACLE_HOME: Specifies the installation directory of Oracle software.
The recommended directory for ofa is $ oracle_base/product/release.
When the data in the table is not required, delete the data and release the occupied space. To delete the data in the table, use the delete statement or the truncate statement.
I. Delete statements
(1) conditional Deletion
Syntax format:Delete
Database indexes store the column values of interest to users along with their row Identifiers (rowid ).
Rowid contains the physical location of the table row storing the column value on the disk.
Although indexes can improve the query
Function Index
Select*From Demot WhereF7= 'F';
Select*From Demot Where Lower (F7) = 'F';
There was a bitmap index on F7, but after using the lower function, the whole table was scanned.
Next, we will
I,Basic SELECT statement
Select * from table name;
Slect field name from table name;
Select identifies which columns to select.From identifies from which table to select.
II,Note:
The SQL language is case insensitive.SQL statements can
(I) Let's first look at two real cases from the production environment:
Case 1
Case 2
(Ii) principle:
Oracle does not perform accurate statistics on each of the varchar and other complex fields.Instead, perform substr (, 32) on the
I,Security guardPL/SQLAnd then begin(Plsqldev902.rar).
II,PendingInstantclient-basic-nt-11.2.0.3.0.zipCopy slaveDAnd the solution is as follows:Oracleplsqlconn.
III,PendingNetwork.zipResolveOracleplsqlconn.
IV,OpenPL/SQLAnd then openPL/SQL,
SQL> -- 1. query data used by employees SQL> select * from EMP; SQL> -- 2. query the salaries of employees whose job is "President" SQL> select Sal from EMP where job = 'President '; SQL> -- 3. query the information of employees whose
View
Database Object-View:
I. view definition: Logical Data Set extracted from the table
A) a view is a virtual table.
B) The view is built on an existing table. The view depends on the created tables, which are called base tables.
C) the
Where and having are both filtering the query results. The book points are the statements that set the conditions. The following describes the usage and similarities and differences. Note: The fields used in this article are the EMP table under
Query statistics are often used in large database systems. However, for systems with large data volumes, users often feel slow when performing complex query statistics and cannot meet application requirements, this requires us to make reasonable
Create a procedure first!
Then create a job to execute her regularly!
(1) create or replace procedure droptable
Tmpname varchar2 (50); cursor ftmp is
Select table_name
From all_tables
Where table_name ''Yyymmdd')-7'
And table_name> = 'tmp '; begin
The ORACLE time field is set to year, month, day, and quarter.
-- Obtain the year, month, and quarter.SelectTo_char (date, 'yyyymmdd') DATE_ID, to_char (date, 'yyyy') | 'Year' | to_char (date, 'mm ') | 'month' | to_char (date, 'dd') | 'day'
The first day of a month
SELECT to_date(to_char(SYSDATE,'yyyy-mm')||'-01','yyyy-mm-dd')FROM dual
Sysdate is the current system time of the database server.To_char is a function that converts a date type into a date type.To_date is a function
Code
(Reprinted)
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Add to favorites the original oracle deadlock killing Process
First, check which tables are locked.
Select B. owner, B. object_name,
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