total and group by with where clause in sub query?

Printable View