Dynamic Views from Mohammad's Query

This is a HANA translation of Mohammad's query, and it outputs the
result in form of a view.