Oracle下SQL基本操作(三)(4)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-26 22:16 点击:次
END 加薪后
FROM EMPLOYEE EMP
UPDATE EMPLOYEE EMP SET EMP.SALARY = CASE WHEN EMP.EMPLOYEEID = '02' THEN EMP.SALARY + 400
WHEN EMP.EMPLOYEEID = '03' THEN EMP.SALARY + 7
ELSE EMP.SALARY
END
-----内置函数
----字符函数
----LOWER
SELECT LOWER(EMP.NAME) FROM EMPLOYEE EMP ;
---UPPER
SELECT UPPER(EMP.NAME) FROM EMPLOYEE EMP;
---SUBSTR
SELECT SUBSTR('123456',2,2) FROM DUAL;
SELECT SUBSTR('123456',2) FROM DUAL;
SELECT INSTR('ABCABC','AB') FROM DUAL;
-----INITCUP
SELECT INITCAP('aaabbgb') FROM DUAL;
----CONCAT
SELECT CONCAT(EMP.NAME,EMP.HIREDATE) FROM EMPLOYEE EMP;
---LTRIM
SELECT LTRIM('AAABCAA','AA') FROM DUAL;
SELECT LTRIM('A12AAABCDAAA12','A12') FROM DUAL;
SELECT LTRIM('A12AAABCDAAA12','12') FROM DUAL;
---TRIM
SELECT TRIM(' AFASFDA AAA ') FROM DUAL;
----REPLACE
SELECT REPLACE('AAABBBBBBBAAA','A','XY') FROM DUAL;
-----TRIM
SELECT TRIM('A' FROM 'ABAXYZABAbAAAA') FROM DUAL;
---LENGTH
SELECT LENGTH('ABC大大') FROM DUAL;
----数字函数
--ROUND
SELECT ROUND(-5.678,2), ROUND(5.678,2) FROM DUAL;
SELECT ROUND(1.678,-1) FROM DUAL;
--TRUNC
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>