How to complete the requirement by writing an oracle sql?

Original text of this message