以下哪个查询操作能够实现将员工的参加工作日期按如下格式显示:月份/年份。
A: select ename,hiredate,to_char(hiredate,'HH/RR') from emp;
B: select ename,hiredate,to_char(hiredate,'MM/RR') from emp;
C: select ename,hiredate,to_char(hiredate,'MON') from emp;
D: select ename,hiredate,to_char(hiredate,'DD/YY') from emp;
A: select ename,hiredate,to_char(hiredate,'HH/RR') from emp;
B: select ename,hiredate,to_char(hiredate,'MM/RR') from emp;
C: select ename,hiredate,to_char(hiredate,'MON') from emp;
D: select ename,hiredate,to_char(hiredate,'DD/YY') from emp;
举一反三
- 以下语句不正确的是( ) A: select * from emp; B: select ename,hiredate,sal from emp; C: select * from emp order deptno; D: select * from where deptno=1
- 以下语句不正确的是( ) A: select * from emp B: select ename,hiredate,sal from emp C: select * from emp order deptno D: select * from where deptno=1 and sal<300
- 智慧职教: 表结构如下:dept(deptno,dname),emp(empno,ename,job,hiredate,sal,deptno)。创建视图查询系部名称、教师姓名,职位,工资信息。
- SQL语句“SELECT<br/>* FROM emp WHERE ename LIKE 'A_'”能够查询字母A开头的所有雇员信息。()
- 列出所有部门的部门名称和部门员工人数。如果部门没有员工,人数显示为0。正确的查询语句有_________。 A: SELECT dname,COUNT(ename) AS ecount <br>FROM dept,emp <br>WHERE emp.deptno(+)=dept.deptno <br>GROUP BY dept.dname B: SELECT dname,(SELECT COUNT(*) AS ecount FROM emp WHERE emp.deptno=dept.deptno) <br>FROM dept C: SELECT dname,COUNT(ename) AS ecount <br>FROM dept LEFT JOIN emp ON emp.deptno=dept.deptno <br>GROUP BY dept.dname D: SELECT dname,COUNT(*) AS ecount <br>FROM dept LEFT JOIN emp ON emp.deptno=dept.deptno <br>GROUP BY dept.dname