I need to make a view in Oracle that will display all rows from last weekday.
So for Tuesday it should be like this cause I need all entries from Monday:
select * from table_1 where to_char(Mydate,'yyyy-mm-dd') = to_char(sysdate-**1**,'yyyy-mm-dd');
But if it is Monday then I need all entries from Friday.
select * from table_1 where to_char(Mydate,'yyyy-mm-dd') = to_char(sysdate-**3**,'yyyy-mm-dd');
How can I make one view that will always display correct rows from last weekday?