I. Defining what a subquery is
When a query is a condition of another query, it is called a subqueryYou can add a subquery anywhere in the SQL. two. When to use subqueries
Use it when the problem cannot be solved in one step.
For example: query
1. Choose the appropriate Oracle optimizer
There are 3 Oracle optimizer types:
A. Rule (rule-based)
B. Cost (based on costs)
C. CHOOSE (optional)
Set the default optimizer to pass various declarations of optimizer_mode parameters in the Init.ora
This is often the case when you use Pl/sql developer to remove users."Unable to delete the currently connected user"
Workaround I post the SQL statement directly
/*
Delete the current connection user
* *-
1, first switch to SYSTEM user
☆ Database----containers for storing dataThe primary function of a database is to save data.The storage structure of the database---how the data is stored in the database
The storage structure of the ☆oracle database:Logical storage structure: How
1 utl_file_dir parameter definition
Utl_file_dir is a "static parameter" in Oracle, and you can set one or more paths. Specifies the path for file I/O operations in Pl/sql (which can be utl_file packages). Utl_file_dir is a "static parameter" in
Problem:
VARCHAR2 (4000) ABC;
Intert into table_name (ABC) VALUES (' Here are 1500 characters ... ');
Error: Insert character too long. After testing, found that a Chinese character accounted for 3 bytes, it will be an error.
The crux of the problem:
--Start
In the database, each row has an address, and we can query the pseudo-column ROWID to get this value.
CREATE TABLE TEST
(
NAME VARCHAR)
;
INSERT into TEST VALUES (' test ');
SELECT ROWID, NAME from TEST;
--Results
ROWID NAME
This example implements the connection string and removes the duplicate item.
An aggregate function is actually an object:[SQL] View Plain Copy create or replace type distinct_concat_type as object ( --Object variable cat_string varchar2 (+
--Start
First, we prepare the test data.
CREATE TABLE TEST
(
NAME VARCHAR2,
birthday DATE
);
INSERT into TEST VALUES (' John ', DATE ' 2014-12-14 ');
INSERT into TEST VALUES (' Dick ', DATE ' 2013-12-14 ');
INSERT into TEST VALUES (' Harry ',
Import Export using Exp/imp
Before starting Exp/imp, there are several points to note:
1 This section takes Oracle 10g for example.
2 Exp, IMP is the next executable file of the operating system, stored in the/oracle_home/bin directory.
So between
Method One: To judge by To_number function anomaly
CREATE OR REPLACE FUNCTION is_number (Str_ VARCHAR2) return VARCHAR2IsNUM_ number;BEGINNum_: = To_number (STR_);Return ' Y ';EXCEPTIONWhen others THENReturn ' N ';End Is_number;/
Sql> Select
L Transfer from: http://www.cnblogs.com/lovemoon714/archive/2012/03/02/2376782.html
1. Overview
1.1, all join connection, can add like where a.id= ' 1000 ' condition, achieve the same effect.
1.2, in addition to the cross join can not add on, other
Table structure:
Name Subject Score
John Language 89
John Math 73
Dick Language 73
Dick Math 73
Required Format:
Name Subject Score
John Language = 89, digital =73
Dick language = 73, digital =73
Query statement:
Select Name, Wm_concat (to_char) (
Directory===============================================1. The arrangement with null value2.top/bottom N Query3.first/last ranking Query4. Query by LevelOne, with a null value of the arrangement:In the previous article on Oracle development topics:
Problem Description: Use Oracle's multiple page query statement, data duplication between different pages, but the database data is correct, query all the time can also be displayed.
SQL instance: Select RowNum rn,ta.* from (select a.*,b.* to
Manually start an ORACLE database instance assume that the instance name ORCL first export the environment variable in the configuration file or set ORACLE_SID=ORCL sqlplus Sys/password as Sysdba sql>startup; The startup command reads the
1. Database Configuration
First of all, your installation database, which is installed here is Oracle, does not explain.
Open the Web-inf/config/systemglobals.properties file, locate the configuration parameters database.driver.name and configure
Query and delete duplicate records SQL statement 1, find redundant records in the table, duplicate records are based on a single field (ID) to determine select * from table where Id in (select Id from table group Byid having count (ID) > 1) 2,
Oracle redo logs
Oracle 's database log is called Redo log, and all data changes are recorded redo log, which can be used to repair a damaged database. The redo log is grouped, and the default is three groups. Redo Log is used in turn, a redo log
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.