: \ selectEmp.txt'
Created file D: \ selectEmp.txt
Get: load the command from the hard disk to the sqlplus environment. Then type run or r or/to execute. For example:
SQL> get 'd: \ selectEmp.txt'
1 * select * from scott. emp
SQL> r
1 * select * from scott. emp
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 smith clerk 7902-12-80 800 20
7499 allen salesman 7698 20-2 month-81 1600 300 30
7521 ward salesman 7698 22-2 month-81 1250
One, how to view the execution plan of SQL statement1, in the Sql*plus environmentPerform set AUTOTRACE on to turn on startup auto-tracking, as follows (the red font below is the typed command):chenzw>set Autotrace onChenzw>select * from EMP; empno ename job mgr HireDate sal COMM DEPTNO--------------------- -------------------------------------------------------------- 7369 SMITH cle RK 7902 1 July-December -80 800 NB Sp 20 7499 ALLEN salesman NBS
coordinate, and then the displacement data is obtained based on the provided xoffset and yoffset parameters. The speed parameter is used to calculate the step.
steps = 1250.0 / speed + 1;end.x = start.x + xoffset;end.y = start.y + yoffset;
The starting coordinate plus the displacement is the ending coordinate. This steps setting is still a bit confusing. I think this 1250 is the maximum displacement, and speed represents the path of each step. Use
of 0.
Nvl data
Next region in the previous region to zookeeper
Nvl functions can convert null values into another item. If you want to calculate the total salary of each employee in the EMP table, the total salary is calculated by Sal + comm. You can calculate the total salary:
SQL> SELECT ENAME, SAL, COMM, (SAL + COMM) TOTAL_SALARY FROM EMP;ENAME SAL COMM TOTAL_SALARY---------- ---------- ---------- ------------SMITH 800ALLEN 1600
(1) simulate user misoperations
SQL> conn Scott/tiger @ demoConnected.SQL> host dateCurrent date: ThursdayEnter a new date: (year, month, day)
SQL> host timeThe current time: 16:40:43. 29Enter the new time:
SQL> select current_scn from V $ database;
Current_scn-----------1975467
SQL> Delete from EMP where deptno = 30;
6 rows have been deleted.
SQL> commit;
Submitted.
(2) Use flashback to query the table row data at an early time point
SQL> select ename, Sal, job, deptno from EMP as of Time
Oracle linesize command
You can use the linesize command to set the number of characters that a row can accommodate. The default value is 80. If the value of linesize is small, one row of data in the table will be displayed in multiple rows on the screen. If the value of linesize is larger, one row of data can be displayed in one row on the screen.The linesize command syntax is as follows:Set linesize nWhere, n indicates that a row of data on the screen can be accommodated.Number of characters,
using 'issue 1 ';
Database link created.
SQL> show userUSER is "SCOTT"SQL> select * from scott. emp @ comparison_link;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO DEP------------------------------------------------------------------------------------------------------------7369 smith clerk 7902 17-DEC-80 800 207499 allen salesman 7698 20-FEB-81 1600 300 307521 ward salesman 7698 22-FEB-81 1250 500 307566 jones manager 7839 02-APR-81 2975 207654 mart
SQL> drop table T1 purge;
The table has been deleted.
SQL> Create Table T1 as select * from EMP;
The table has been created.
SQL> ALTER TABLE T1 Add a varchar2 (20 );
The table has been changed.
SQL> select * from T1;
Empno ename job Mgr hiredate Sal comm deptno-------------------------------------------------------------------------------------------------------7369 Smith clerk 7902-12-80 800 207499 Allen salesman 7698 20-2 month-81 1600 300 307521 ward salesman 7698 22-2 month-81
buffers 2945024 bytesThe database has been loaded.
SQL> flashback database to timestamp to_date ('2017-01-02: 13: 20: 59 ',2 'yyyy-mm-DD: hh24: MI: ss ');
Flash back complete.
SQL> alter database open resetlogs;
The database has been changed.
SQL> select * from Scott. EMP;
Empno ename job Mgr hiredate Sal comm deptno-----------------------------------------------------------------------------------7369 Smith clerk 7902-12-80 800 207499 Allen salesman 7698 20-2 month-81 1600 300 307521 ward sale
Arranges (rank ()) functions. These permutation functions provide the ability to define a set (using the PARTITION clause), and then arrange the elements in the collection according to some sort of order, and the following is an example of the Scott User's EMP table to illustrate how the rank over PARTITION is used.
1 Check employee salary and sum continuously
Select Deptno,ename,sal,
sum (sal ename) sum1,
sum (SAL) over () sum2,
100* round (sal/sum (SAL) Over (), 4 "bal%
relationship. SELCT * from Warehouse; --3. Search for employee numbers with a salary of more than $1230. Select work_id from worker where wages >1230; --4. Retrieve which warehouses have workers with a salary of more than 1210 yuan. Select ware_id from worker where wages>1210; --5. Give a worker's number that works in the warehouse "WH1" or "WH2" and has a salary of less than 1250 yuan. Select work_id from worker where (ware_id = "WH1" or ware_id = "
Eeee
9.99EEEE
Scientific notation means
L
L999
Add a local currency symbol to the number before
PR
999PR
If a numeric negative number is represented by angle brackets
Code Demo: To_char Processing of numbersSelect To_char ( -123123.45, ' L9.9eeeepr ') "date" from dual;2, To_date (X,[,FMT])Converts a string into a date type in the FMT format3, To_number (X,[,FMT])Converts a string to a number in the FMT formatCode D
all the keywords starting with K irrelevant to the topic in the engineering index designerKMP Korg Trinity KeyMap FileKQP Konica camera local fileKR1 Kurzweil 2000 sample (Multi-soft drive) FileKRZ Kurzweil 2000 sample fileKSF Korg Trinity sample fileKYE Kye game dataLAB Visual dBASE label FileLBM Deluxe Paint bitmap fileLBT, LBX Microsoft FoxPro Tag fileLDB Microsoft Access lock fileLDL Corel Paradox distribution LibraryLEG Legacy documentLES Logite
thousand, but the market price is not transparent, so the price can be sold at will. Through strong public relations in the market, ruike's purchase of their machines must be VIP customers who had film dealings with them earlier. In this case, the prices of the machines sold will certainly not be cheap, it may sell for about 0.9 million. However, there are more customers in the market that are not fixed by ruike and that are sensitive to the transaction price. to compete for this cake, the Agen
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.