how to perform such in single query??

Printable View