1, using ORDER BYChinese character coding rules, there is a reference to the following sentence: "First-class Chinese characters, is the most commonly used Chinese characters, alphabetical alphabetical order, a total of 3,755, two-level Chinese
Linux installs Oracle client separately (Oracle clients)
Updated: 2013-10-17 18:30
|
Tags:linux oracle
1. To use Oracle remotely, download the following three files first, and note that the best version is the same.
DECLARE num number; Beginselect COUNT (1) into NUM from user_tables WHERE table_name = UPPER (' TableName '), IF num > 0 Then EXECUTE immed Iate ' DROP TABLE tableName '; END IF; END; Multi-table casedeclare num number; NUM1 number;num2
First, create a table:
CREATE TABLE Example (
ID Number (4) Not NULL PRIMARY KEY,
NAME VARCHAR (25));
Then, customize a sequence (sequence):
CREATE SEQUENCE example_sequence
INCREMENT by 1--add a few each time
1. Add a second instanceConfiguration and Porting tool-->database configuration Assistant then create the instance step-by-step (instance named ORCL2)After the successful creation, there will be a service named OracleServiceORCL2 in the service of
Data files and log files are the most important files in the database. They are where the data is stored. Each database has at least one data file associated with it, and usually more than one, there are many. How is the data organized in the data
SELECT *From T_info AWHERE (SELECT COUNT (*)From T_infoWHERE Title = a.title) > 1)ORDER by Title DESCOne. Find Duplicate Records1. Find all duplicate recordsSELECT * FROM table Where repeating field in (Select repeating field from table Group by
I. Modifying and maintaining Table spaces1. Increase table Space capacityYou can increase the capacity of the tablespace by modifying the size of the tablespace data file or by adding a data file to the tablespace, and we can also use the
I. Creating a table space for non-standard blocksIn the database, you can create a table space that differs from the database standard block size, which can transfer tablespace between two databases with different block sizes. Before creating a
Data types in Oracle/*data types in ORACLE; char length fixed range: 1-2000 VARCHAR2 length variable range: 1-4000 long length variable maximum range 2gb longer character type numb ER numeric number (p,s) date type, accurate to seconds TIMESTAMP
1.oracle Open File handle numberSql> Select COUNT (*) from V$open_cursor;COUNT (*)----------15652.number of connections to OracleSql> Select COUNT (*) from v$session;COUNT (*)----------863. Current number of processes Sql> Select COUNT (*) from
CREATE OR REPLACE FUNCTIONFind_in_set (PIV_STR1varchar2, PIV_STR2varchar2, P_sepvarchar2:= ',') RETURN Number isL_idx Number:=0;--used to calculate the position of separators in PIV_STR2 Str varchar2( -);--substring intercepted by
What we will learn in this chapter are:
How to use Set operators, which combine the rows returned by two or more queries
Using the Translate function
1. Using the SET operator
Operator
Description
In many cases, we will need to insert a large amount of data into a table, and hope to complete the work in as short a time as possible, here, and share with you some of my usual experience in doing a lot of data insert.Premise: Before making the
SELECT A.areaname AS Level two place name from houses h,houses H2,Areas a WHERE H.areaid=a.areasid and H2.areaid=a.areasid and H.finalassessmentid=1 andH.houseslevel=2 and H2.houseslevel=1 and A.areasid!=a.parentareasid and a.companysid=2;SELECT *
SELECT A.areaname AS Level two place name from houses h,houses H2,Areas a WHERE H.areaid=a.areasid and H2.areaid=a.areasid and H.finalassessmentid=1 andH.houseslevel=2 and H2.houseslevel=1 and A.areasid!=a.parentareasid and a.companysid=2;SELECT *
1, randomly fetching records from the tableSelect * from(Select * fromStaffOrder bydbms_random.random)whereRowNum 4To randomly fetch 3 records from the staff table2, generating random numbersSELECTDbms_random. RANDOM fromDUAL; produce a random
Suppose there are two tables, a, B, there is only one field phone1,minusSelect Phone from A minus select phone from B; Equivalent to the result set minus result B by result set a. The same effect can be achieved with the select PHONE from A where is
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