I have got the situation where I have to get the 3 business day difference between two dates and if Yes then have to update the Flag accordingly.
Thanks Raja :) but I was talking about Business Day calculation , this will give me total diffrence which will include weekends also.
The solution I prefer is a business_day number column in my calendar table, then you simply do two joins on start_date/end_date and calculate the difference.
As you have rules what's a business day (not including weekends, public holidays, ...) you probably already got a column with a flag indicating working days.
The new column is populated with a SUM(CASE WHEN workday_flag = 1 THEN 1 ELSE 0 END) OVER (ORDER BY calendar_date), so saturday and sunday will have the same number as friday and on monday it's increased.