Reputation: 213
I want to make a query in Oracle that shows all the records in which the employees are in the 'IT DEPARTMENT' and have been working between 3 and 8 years.
I have the table:
The IT Department has ID 60 in the table, how can I do the query with records from the table? Please help! :(
Upvotes: 0
Views: 138
Reputation: 12169
Try this:
select * from job_history
where end_date - start_date between 1095 and 2920
and department_id = 60;
1095 = 3*365
2920 = 8*365
Upvotes: 1