'how to iterate each row using CTE in postgresql

for each dept, multiple employee and each employee's date columns all are zero. how to get this rows through postgres query

[1]: https://i.stack.imgur.com/JfHNk.png



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source