Oracle database query


Summary: 1 grant connect authority to: Grant Connect, Resource to hankai
2. SELECT query and modify update given permission to: Grant the SELECT, update ON scott.emp to hankai with the Option Grant;
3. Cancellation rights: revoke select, update on scott from hankai .emp
4. full coupling: the full result set is coupled to the coupling condition is satisfied in addition to the recording, there are recorded left and right table does not meet the conditions
difference and where the 5.having: HAVING is a packet (group by) the use; WHERE packet before using
sub 6.from query: the query result as a table to query
7.union: to re-query is; removing portions of two duplicate query results; INTERSECT: returns the two query common row, is common to two portions of the query results; minus: negative results that match the first query and the second query result in the query can occur
connections within 8.: select * from emp join dept on emp.id = SELECT * from EMP dept.id, Dept WHERE emp.id = dept.id
9. The left connection: SELECT * from the Join Dept EMP left ON emp.id = dept.id;
10. The right connection: select * from dept right join emp dept.id emp.id = ON;
11. The whole external connection; the Oracle Support full outer join Mysql does not support full outer join: select * from emp full join dept on emp.id = dept.id
12.from subquery; as a result set the table when the need to put in brackets
inquiry department number is the average salary of employees of 30 departments: the SELECT AVG (SAL) from (the SELECT * from emp the WHERE the dept = 30)
13. The paging query: actually the query as a table so that the table is in the field rownum num, it can be directly used as condition for
select * from (select rownum as num , emp. * from emp) where num> = 1 and num <= 5 ; (this page -1) * Article number <variable> = (this page) * number of pieces
14 connected to the operator; is the string concatenation: select 'job number for' || empno || 'name is' || ename || 'salary' || SAL from EMP aS STR
15. a capitalized function; result Nihao: SELECT INITCAP ( 'NiHao') from Dual
16. a uppercase to lowercase; check out this column fields are converted into lowercase : SELECT Lower (ename), SAL, COMM from EMP
17. a specified letters removed; xyz remove only the first occurrence of any of a letter to remove, is not removed again later: select ltrim ( 'xayzdm', 'xyz' ) from Dual
18. a letter to the right of the removal: select rtrim ( 'xayzdm', 'xyz') from dual

 

Guess you like

Origin www.cnblogs.com/hankai2735/p/11702826.html