--SELECT to_char(SYSDATE,'yyyy-mm-dd fmhh:mi:ss') FROM dual;
--SELECT to_date('2017-04-25 13:56:30','yyyy-mm-dd hh24:mi:ss') FROM dual
--SELECT MOD(5, 3) FROM dual
--SELECT COUNT(e.comm) FROM emp e
--select avg(e.sal) FROM emp e
--select SUM(e.sal) FROM emp e
SELECT e.deptid 部门编号, AVG(e.sal) 平均工资,
SUM(e.sal) 部门工资总和, COUNT(*) 部门人数
FROM emp e GROUP BY e.deptid
--SELECT DECODE(e.ssex, 0, '男', 1, '女', '不详') 性别 FROM emp e
--SELECT SUBSTR('qwertyuiop', 2, 4) FROM dual
--SELECT e.deptid, MAX(e.intime) 最大 FROM emp e GROUP BY e.deptid
--SELECT * FROM emp e WHERE e.intime = (SELECT max(intime) FROM emp)
--SELECT TRUNC(12.8) FROM dual
SELECT TRUNC(e.intime) FROM emp e WHERE e.empname='www'
WHERE intime = to_date('20170616','yyyymmdd')
--SELECT CEIL(12.3) FROM dual;
--SELECT FLOOR(12.8) FROM dual;
--SELECT ROUND(12.8) FROM dual
--SELECT nvl(e.comm, 0) FROM emp e
--SELECT NVL2(e.comm, '有东西', '啥也没有') 是否空 FROM emp e
--SELECT LOWER('AbC') FROM dual
--SELECT UPPER('AbC') FROM dual
--SELECT CONCAT('hello ','world') FROM dual
SELECT wm_concat(e.empname) FROM emp e GROUP BY e.deptid

posted on 2017-06-14 16:07  缘来狠狂  阅读(141)  评论(0编辑  收藏  举报