How To apply Semimerge Row in Postgres sql?

I am try to find out my result but I am unable to find please help. I am attaching problem image .In this image I gave what actually is problem.

You might want to post to a PostgreSQL forum. This is primarily SQL Server