Create a query that will display the total number of employees and of that total the number who were hired in 1980, 1981, 1982, and 1983. Give appropriate column headings.
RE: Create a query that will display the total number of employees and of that total the number who were hired in 1980, 1981, 1982, and 1983. Give appropriate column headings.
select count(*) as Totalnoofemployees to_char(dateofjoining 'yyyy') as hiredyear from tablename
RE: Create a query that will display the total number of employees and of that total the number who were hired in 1980, 1981, 1982, and 1983. Give appropriate column headings.
select emp_id from employee_details group by emp_doj where emp_doj in (1980 1981 1982 1983);
RE: Create a query that will display the total number of employees and of that total the number who were hired in 1980, 1981, 1982, and 1983. Give appropriate column headings.
select count(*) as Totalnoofemployees to_char(dateofjoining 'yyyy') as hiredyear from tablename
RE: Create a query that will display the total number of employees and of that total the number who were hired in 1980, 1981, 1982, and 1983. Give appropriate column headings.
RE: Create a query that will display the total number of employees and of that total the number who were hired in 1980, 1981, 1982, and 1983. Give appropriate column headings.
I believe a small change to one of the answers already given here should give the desired results.
select count(*) as "Total Number of Employees" count(decode(to_char(hiredate 'YYYY') '1980' empno) ) as "1980" count(decode(to_char(hiredate 'YYYY') '1981' empno) ) as "1981" count(decode(to_char(hiredate 'YYYY') '1982' empno) ) as "1982" count(decode(to_char(hiredate 'YYYY') '1983' empno) ) as "1983" from emp ;
RE: Create a query that will display the total number of employees and of that total the number who were hired in 1980, 1981, 1982, and 1983. Give appropriate column headings.
RE: Create a query that will display the total number of employees and of that total the number who were hired in 1980, 1981, 1982, and 1983. Give appropriate column headings.
SELECT count(*) FROM emp where TO_CHAR(hiredate 'YYYY') in (1980 1981 1982 1983);
RE: Create a query that will display the total number of employees and of that total the number who were hired in 1980, 1981, 1982, and 1983. Give appropriate column headings.
RE: Create a query that will display the total number of employees and of that total the number who were hired in 1980, 1981, 1982, and 1983. Give appropriate column headings.
using INLINE's
select ename sal job e1.noofemployees from emp (select count(*) noofemployees from emp) e1 where to_char(hiredate 'YYYY') in (1980 1981 1982 1983);
using set operator:UNION
select nvl(to_char(null) 'no.of employees') empdetails to_char(to_date(count(*) 'j') 'jsp') jobsalongwithnoofemployees from emp union select ename job from emp where to_char(hiredate 'YYYY') in (1980 1981 1982 1983);