I have a Mysql database with a table having two columns Department and deals as:
Department | deals
HR | A1
Sales | A2
Revenue | A1
HR | A3
I want to display the data in asp.net gridview as:
A1| A2 | A3
HR 1 0 1
Sales 0 1 0
Revenue 1 0 0
How can I do the same as the values under deals are not known or fixed. I am using below but its not showing desired output
SELECT GROUP_CONCAT(CONVERT(deals,char(10)))
FROM Table1
group by Department