Andrea Tand
Andrea Tand

Reputation: 91

ORACLE SQL: view, which will only show details of employees if it is used between the hours of 11:00 and 13:00

I have a data table called EMPLOYEES with basic data like employee number, name, job, and salary. I know how to make a view but is there a way of making a view whose data can only be seen or accessed within certain hours, say between 11:00 and 13:00?

Upvotes: 0

Views: 37

Answers (1)

amaksr
amaksr

Reputation: 7745

You can just add condition to WHERE clause of your view:

CREATE VIEW my_view AS
SELECT ...
FROM ...
WHERE to_char(SYSDATE, 'HH24') BETWEEN 11 AND 13

Upvotes: 1

Related Questions