Raghavendra, did you ever read the The SCN Rules of Engagement? You posted this requirement four times on different posts which are not related to your requirement and you created a new question (hi very critical requirement has given to me ANYBODY can help me in writing in SQL SAP HANA).
Regarding your requirement. All points are already clearly described, you only have to translate it to an efficient SQL. I think you have to investigate yourself how SQL works. Otherwise you can send your customer to anyone who has the knowledge to do it w/o solving the most simple requirements with the help of a forum
.