views:

64

answers:

1

I've SQL Server 2005 table COMPETITOR (Id, Title, cDate, Price) I want to format the query so that its view in Gridview will be like this: alt text

Please help me writing the sql query.

+1  A: 

SQL 2005 supports PIVOT - the Books Online doc is http://msdn.microsoft.com/en-us/library/ms177410(SQL.90).aspx

The main shortcoming I've found with the PIVOT stuff is that you must specify the column names, although you can use a query beforehand and inject the values into a varchar variable and then execute that.

Doogie