Not sure how to do this in SQL?

Printable View