|
P4
|
发表于 2012-5-17 10:33:49
1. select ename,sal/30 from emp;
2. select * from emp where ename like '%A%';
3. select * from emp where hiredate=last_day(hiredate);
4. select * from emp where months_between(sysdate,hiredate)/12>25;
5. select * from emp where ename=initcap(ename);
6. select * from emp where length(ename)=6;
7. select substr(ename,1,3) from emp;
8. select replace(ename,'A','a') from emp;
9. select ename,add_months(hiredate,12*10) from emp;
10. select ename,hiredate from emp order by hiredate;
11. select ename,to_char(hiredate,'yy') y,to_char(hiredate,'mm') m from emp order by m,y;
12. select ename,hiredate from emp where to_number(to_char(hiredate,'mm'))=02;
13. select ename,ceil(sysdate-hiredate) from emp;
14. select ename,months_between(sysdate,hiredate)/12 year,months_between(sysdate,hiredate) month,sysdate-hiredate day from emp; |
|