Oracle cross-Library query table data createtime--2018 April 14 11:56:54author:marydon1. Usage ScenariosWhen you need to access the data in library B from a library, you need to connect the two libraries together.2. Code implementationFirst step:
1. Create a table, delete a table, copy a tableCREATE TABLE stuinfo-- creating learner information Tables(Stuno Char (6) NOT NULLStuname varchar (2) not nul,Stuage number (3,0) NOT NULL)Create a new table copy the Learner Information table is:CREATE
1. Insert a record into Scott's EMP tableInsert into Scott.emp (empno,ename,job) VALUES (9527, ' EAST ', ' salesman ');2. Scott's EMP Table left Outer Connection Dept tableSelect E.empno,e.ename,e.job,d.deptno,d.dnameFrom Scott.emp E left join Scott.
1. Database creationNote:1) Unlike MySQL, Oracle can create database directly2) Oracle creates schema with one user, that is, the schema's access user, and user one by one, but there can be multiple access users (with permission control)1.1 Creating
Oracle's self-increment relies on sequences and triggers to implement togetherLike creating a new table.createtabletest(id intprimarykey,namevarchar2(10));Create a sequencecreate sequencetest_seq increment by1 start with1 minvalue 1 maxvalue 99999999
When using Rman for recovery, if you use the set name to modify the file path, then after the recovery, the information inside the control file is not modified, if you want to synchronize the control file information then you need to useSwitch
--1. Query which department's average salary is the highest, listing departmental codes and average wages.Select Deptno,avg (SAL) from the EMP GROUP by DEPTNO have avg (sal) = (select Max (SAL) from the EMP Group by DEPTNO);--2. Lists information
Common indexes for Oracle are the Btree index and the bitmap index.Btree Index Features:Default IndexSuitable for a large number of additions and deletionsCannot use the OR operatorSuitable for high cardinality columns (that is, multiple unique
Set Linesize 300;//Sets the length of each row set PAGESIZE 100;//sets the length of each column conn username/password [as SYSDBA], if the SYS user must add SYSDBA when the logged on user is sys/ For other users such as system, if you want to query
2. Using SQL for multi-table queries(1) Unconditional multi-table queryCartesian set: Total number of records =number of table1 records xtable2 RecordsSELECT * FROM table1, table2(2) equivalent connectionInternal connection:Select Tab1.f_z, tab2.*
For foreign keys in Oracle, let's start with a description.1. Oracle will not allow the creation of a foreign key constraint for a child table unless a parent table primary KEY or UNIQUE key constraint has been defined.2. When defining a FOREIGN KEY
1. Oracle automatic growth for primary keysIn general, we implement primary key auto-growth in Oracle, usually through sequence plus trigger.Defines the sequence used to get incrementing numbersCREATE SEQUENCE 序列名[INCREMENT BY n][START WITH n]
Linux Restart MySQL service http://blog.csdn.net/king_1421484363/article/details/73277771[[email protected] ~]service MySQL start[[email protected] ~]service MySQL stopIf the service is in the boot state, restart the service directly for the
In this tutorial, you will learn how to use the Oracle ANY operator to compare values to a list or subquery.Introduction to the Oracle any operatorThe Oracle ANY operator is used to compare a value with a value returned by a subquery or a list of
To ensure that Oracle starts the service automatically after the next system reboot, we can do this with a shell footstep. Assume that the footstep name is/app/oracle/oraclestart.sh, which reads as follows:#!/bin/shsu-oracle Note that this script
1. Avoid using not and on indexed columns! =, the index can only tell us what exists in the table and cannot tell us what does not exist in the table2. Replace > with >= on index column3.oracle parses the WHERE clause in a bottom-up order, so that
(Les10 data restoration Management) [20180323], les1020180323Purpose description DML and data restoration generation monitoring and management data restoration description different configurations between data restoration and redo data restoration
Differences between varchar, varchar2, nvarchar, and nvarchar2 in Oracle and other data types, varchar2nvarchar2
-- Varchar, varchar2 contact: 1. varchar/varchar2 is used to store variable-length strings
For example, if varchar (20) is saved to
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