I thinking about modify to ITVF, but i think it will be very hard and slowlier like one query...
1. I have to declare variable
2. alone queries are very faster, but together like function is problem,, but it has sometimes different behaviour like i wrote above.
3. I tried replace without variable and it looks very bad with repeate selects. for example select for work_date,work_date_pre and etc.