Recently practiced a SQL to share to everyone,First on the topic:--Department tableCREATE TABLE DEPT (DEPTNO INT PRIMARY KEY,--Department numberDname VARCHAR (14),--Department nameLOC VARCHAR (13)); --Department AddressINSERT into DEPT VALUES (' ACCOUNTING ', ' NEW YORK ');INSERT into DEPT VALUES ("DALLAS");INSERT into DEPT VALUES (' SALES ', ' CHICAGO ');INSERT into DEPT VALUES (+, ' OPERATIONS ', ' BOSTON ');--Employee tableCREATE TABLE EMP(EMPNO IN
of rows */ProcSQL Noprint; Select Count(*) into: NumRows fromSasuser.schedulewhere Year(begin_date)=2002;%Let NumRows=NumRows; / * Eliminate the blanks * /%Put there isNumRows Coursesinch 2002; SelectCourse_code, location, begin_date format=Mmddyy10. into: CRSID1-: Crsidnumrows,:p Lace1-:p Lacenumrows,:d ate1-:d ateNumRows fromSasuser.schedulewhere Year(begin_date)=2002 Order bybegin_date;%put _user_;quit;CreateOne macro variable that would Hold all values of a certain data set var
Some sub-queries
select empno, ename from emp where mgr in
(select empno from emp where job=‘MANAGER‘);
select * from dept where Deptno not in ( select distinct deptno from EMP
select * from dept where deptno not in (select deptno from emp);
select empno, ename, sal from emp where mgr=
(select empno from emp where ename=‘SCOTT‘);
select * from emp where sal > 1.4*
(select avg(sal) from emp);
insert into dept(deptno, d
mydept; synonyms have been deleted. SQL> Select * frommydept; # #删除共有同义词, the private ones are still there DEPTNO dname LOC---------- -------------- ------------- TenACCOUNTING NEW YORK -DALLAS -SALES CHICAGO +OPERATIONS Bostonsql> Dropsynonym mydept; synonyms have been deleted.SQL> Select * frommydept;Select * frommydept*Section1line error: ORA-00942: Table or view does not existTo view a synonym view:Sql> Select * fromuser_synonyms; Synon
executed 3 times and 1 times respectively, indicating that the execution plan was reused.3.2 Execution of the following 3 statements select * person.address where addressid = 1 go select * from person.address Span style= "color: #0000ff;" >where addressid = 2 go select * from Person.Address where addressid = 3 go As a result, a plan cache is generated for each adhoc query, respectively3.3 Perform the following parameters query 2 timesexec sp_executesql n'select * from perso
The RowType types in PL/SQL are very useful and flexible, and now find RowType in INSERT and UPDATE statements that can save a lot of code, especially when it comes to copy and update. In Google's search results, I look at the foreign language to see the dizzy dizzy when found, surprise Ah! There is no such book in the Oracle's official website, and I don't know how.DeclareV_dept Dept%rowtype;BeginV_dept.deptno: = 60;V_dept.dname: = ' sample ';V_dept.loc: = ' Chicago ';INSERT INTO dept values V_
by changes in the table structure.Records can be assigned as a wholeRowType ReferenceRowType Reference Read data into the RowType type Create table testtable ();R Testtable%rowtype; Select * into R from TestTable where pno= ...;RowType type data into the table Insert into Testtable2 values r;
-----------------------------------------------------
-----------------------------------------------------DECLARE v_dept Dept%rowtype; begin V_dept.deptno: = ;V_dept.dname: = ' sample '; V_dept.loc: =
Label:First, the conceptModel Model:
A model that describes relational data. is a set of data stores that are stored in a specific technology, such as Oracle. For example, when the technology is Oracle, the scheme corresponding to the database
DataStore: Data Storage
A model contains metadata that corresponds to a table or view in the scheme in which the model resides. Can be imported from a real environment via reverse engineering (reverse-engineered) or created in ODI
---------- -------------- ------------- Ten ACCOUNTING NEW YORK DALLAS SALES CHICAGO OPERATIONS BOSTON Sql> *************************************************************************************************************** **************************** Analysis of data pump export data in oracle10g *************************************************************************************************************** **************************** The data pump in
, the combination of bankruptcy, from the industry disappeared.
02, Time Warner-AOL
When the acquisition of others, AOL did not think that they will have this day. Of course this is not a takeover, just a merger. Six years ago, the two giants were married, and six years later, rumors of a split and a sale are continuing. Obviously, the effect of the merger of two companies is not ideal, in addition to mismanagement, AOL is also due to the loss of network advertising revenue, Time Warner has been
WiFi location is a new application service after the iphone has been upgraded to 1.1.3, and after getting the machine, start experimenting with WiFi positioning. In Dallas, USA, the location button was pressed and rotated for about 2 seconds, and the street immediately flashed to the center of the screen. No wonder Jobs also said: "It's really cool", this function is really amazing.Previously used GSM positioning, the error can be large to several kil
Buy a minimum model 512M OpenVZ VPS in just 5.05 dollars. Unlike in the previous months, their Los Angeles engine room speed has returned to normal, telecommunications average ping about 180. In addition, their home also has Miami, Chicago and other rooms can be selected.
Busrt previously also introduced in detail, specific you can search the site before the introduction, here is not detailed, directly to the discount code, the need for students to grasp the start.
Discount Code: Summerend
Di
Accelerator for Innovation and Research) project of the Canadian Quasi-government agency Canarie Network provides a study and development cloud computing environment for universities and small and medium-sized enterprises Dair users can quickly establish a network topology as needed.HP Cloud (using Ubuntu Linux)MercadoLibre's IT Infrastructure cloud, now manages more than 6000 virtual machines with OpenStack.Att's "Cloud Architect" will provide cloud services outside
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.