Hi,
i have three tables representing 3 types of employees in a company.
Table 1: Adminstaff
Table 2: ITStaff
Table 3: Clerk
in each of these tables i have an attribute that stores the date of the employment start (e.g. 11/10/2007)
and each table has a primary key attribute empno.
now i would like to write a query that shows me the number of employees that joined in a specific year.
like 2 joined in 2008
5 joined in 2007 ....
i know how to write the query for one table but dont understand how to connect/join all three tables.
select count(empno), to_char(emp_start,'yyyy') from adminstaff group by to_char(emp_start,'yyyy') order by count(empno) desc;
i was trying to use UNION but that gives me year and sum of each table.
thanks in advance