|
2015-08-13a.sql
- select 'a'||'b'||'c' from dual;
- select concat(concat( 'a','b'),'c') from dual;
- select substr('Hello World',2 ) from dual;
- select substr('Hello World',2,1 ) from dual;
- select substr('Hello World',-2,1 ) from dual;
- select length('Hello World') from dual;
- select lengthb('Hello World') from dual;
- select instr('Hello World','a') from dual;
- select lpad('a',2,'*') from dual;
- select trim('e' from 'Hello World') from dual;
- select replace ('Hello World','o') from dual;
- select replace(substr('Hello World',1,5),'o')||' '||substr('Hello World',7) from dual;
- select sysdate from dual;
复制代码 2015-08-13b.sql
- SELECT department_id, AVG(salary)
- FROM employees
- where department_id>80
- GROUP BY department_id
- having AVG(salary) >8000
- ;
- select employee_id ,salary from employees e
- where salary > ( SELECT AVG(salary)
- FROM employees a
- where a.department_id=e.department_id
- GROUP BY a.department_id );
-
-
- select e.employee_id , e.salary , e.department_id from
- (SELECT department_id, AVG(salary) avgsal
- FROM employees
- GROUP BY department_id
- ) a , employees e
- where a.department_id=e.department_id
- and e.salary > a.avgsal
- ;
-
-
-
-
复制代码
上完1Z0-051第3章 (52-27)
上完1Z0-051第4章 (52-28)
上完1Z0-051第5章 (52-29)
|
|