.JONES's salary is 2975.MARTIN's salary is 1250.The salary of BLAKE is 2850.CLARK's salary is 2450.SCOTT's salary is 3000.KING's salary is 5000.TURNER's salary is 1500.ADAMS's salary is 1100.JAMES's salary is 950.FORD's salary is 3000.MILLER's salary is 1300.
You can also use the concat () function ():SQL> select concat ('hello', 'World') from dual;
6. likeWhen using like, you can use % and _ to represent any number of characters or any character.To e
emp group by rollup (job, deptno); query the employee table, groups positions in different departments, subtotal and total job deptno TOTAL_SALCLERK 10 1300 CLERK 20 1900 CLERK 30 950 CLERK 4150 ANALYST 20 6000 ANALYST 6000 MANAGER 10 2450 MANAGER 20 2975 MANAGER 30 2850 MANAGER 8275 SALESMAN 30 5600 SALESMAN 5600 PRESIDENT 10 5000 PRESIDENT 5000 --> PRESIDENT position total 29025 ---> total if year does not want to accumulate, select year, month, Ar
Common Oracle functions: nvlnullifcasewhenwm_concatreplace
Common Oracle functions: nvl/nullif/case when/wm_concat/replace
1. nvl Function The nvl function converts a null value to an actual value. The data type can be date, number, character, and must match: for example:Nvl (commision, 0) Nvl (hiredate, '01-JAN-87 ') Nvl (job_id, 'no manager ') Nvl (to_char (job_id), 'no manager ') Nvl can convert any data type, but the returned value of the converted data type must be the expr type of the f
Common Linux Driver selection for Dell servers-Linux Enterprise Application-Linux server application information. The following is a detailed description. The main driver is Nic and RAID card. Generally, you can use commands such as lspci, lsmod (module driver), and dmesg.
1. 1X50 series:
1750 RAID card Fusion MPT device support -- Fusion MPT (base + ScsiHost) drivers
Nic 2 tg3. Broadcom Tigon3 support (integrated card)
1850 -- the CPU is IA32E or EM64T, which can be used as 32-bit or AMD64 (x
)--------------------30 1566.6666720 217510 2916.66667
Idle>Group and sort againIdle> select deptno, avg (sal) from emp group by deptno order by deptno;
Deptno avg (SAL)--------------------10 2916.6666720 217530 1566.66667
Idle>The Group modifier column can be an unselected column.Idle> select avg (sal) from emp group by deptno order by deptno;
AVG (SAL)----------2916.6666721751566.66667
Idle>
If the grouping function is used in the query, any column or expression that is not in the grouping fun
Sort values in different columns based on conditions.
Sometimes the ordering requirements are complex. For example, if a leader is more interested in employees with salaries between 1000 and 2000 yuan, the employees with salaries in this range must be at the top, for priority.
Create a test table:
Create or replace view v ASSELECT 'martin 'AS ename, 950 AS sal from dualunion allselect 'werd' AS ename, 1250 AS sal from dualunion allselect 'terner' AS ename, 1500 AS sal from dualunion allselect
C # It takes only 4 seconds to import 1 million pieces of data into the SQL Server database (with source code) 2010-10-13 from: cnblogs font size: [large, medium, small]
Abstract: This article introduces four methods for importing millions of data into the SQL Server database in C # and compares their efficiency. sqlbulkcopy can efficiently import data, test code and data are provided for download.
In practice, you sometimes need to import a large amount of data into the database and then u
(Comm, 0) in(Select Sal, nvl (Comm, 0)From EMPWhere deptno = 30)And deptno Method 2: Select ename, deptno, Sal, commFrom EMPWhere Sal in (select SalFrom EMPWhere deptno = 30)And nvl (Comm,-1) in (select nvl (Comm,-1)From EMPWhere deptno = 30)And deptno 6. Use subquery in the from clauseExample:Select a. ename, A. Sal, A. deptno, B. salavgFrom emp a, (select deptno, AVG (SAL) salavgFrom EMPGroup by deptno) BWhere a. deptno = B. deptnoAnd a. SAL> B. salavg;
Result:Ename Sal deptno salavgKing 5000
11750 0 120 clerk 3100 0 020 analyst 6000 0 020 manager 2975 0 020 12075 0 130 clerk 950 0 030 manager 2850 0 030 salesman 5600 0 030 9400 0 133225 1 1
14 rows have been selected.
6. grouping set1) grouping sets are further extensions of the Group by clause.2) multiple groups can be defined in the same query using grouping sets.3) the Oracle server calculates all groups specified in the grouping sets clause.4) Efficiency of grouping sets:-Only one qu
)From EMPWhere deptno = outer. deptno );Result:Ename deptno SalAllen 30 1600Jones 20 2975Blake 30 2850Scott 20 3000King 10 5000Ford 20 3000Wang 10 3000
3. exists operationThe exists operation checks the rows that exist in the subquery result set:1) if a subquery row value is found:-The search in the internal query does not continue-The condition is marked as true.2) If the row value of a subquery is not found-The condition is marked as false.-Search continues in the internal Query
For example, f
Yesterday, I suddenly found that the Oracle server I installed does not have scott users, so I cannot import it manually.
Specific Method:
First, log on with the system user.
Import the scott. SQL script (which can be found in the oracle installation directory). For example, import the local path and write it as follows:
@ D: \ app \ Administrator \ product \ 11.2.0 \ dbhome_1 \ RDBMS \ ADMIN \ scott. SQL
Next, enter:
Alter user scott identified by tiger; change scott Password
Alter user scott
Cross-connection and full-connectionIn addition to displaying rows that meet the conditions of the join, the results also show all rows that meet the search conditions in the tables on both sides of the join operation.SQL> select e. empno, e. ename, e. sal, d. grade2 from emp e full outer join salgrade d3 on e. sal between d. losal and d. hisal;EMPNO ENAME SAL GRADE----------------------------------------7839 KING 5000 57902 FORD 3000 47788 SCOTT 3000 47566 JONES 2975 47698 BLAKE
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.