Are you Using SQL? Also are you trying to display the results in an ASP.Net Page using Visual Studios? or just in SQL, if using SQL.
If just in SQL the query by MattD should work.
If in ASP.Net using visual studios, under the data category drag the sql data source into the design view, hover the mouse over the new control and select the arrow in the upper right corner, select configure data source, create the connection string, then click next. Next select custom query, then paste MattD’s query into the feild. click next, finish
Next on the design veiw drag the gridveiw onto the screen where u placed the last control. select the configure datasource as you did for the previous control, select datasource1, or create new if not there. That should be it. to veiw results, click veiw in browser in the menubar on the top of the page.