I have a complicated query to make in PostgreSQL.Have no idea how i can able to achieve this. May be someone can show some light it will be really helpful.
So below i