I have a table (in MySQL) with 3 columns:
Location Category Supplier
A Computers Company X
A Printers Company Y
B
What you seek is often called a crosstab. This can be done statically like so:
Select Location
, Min( Case When Category = 'Computers' Then Supplier End ) As Computers
, Min( Case When Category = 'Printers' Then Supplier End ) As Printers
, Min( Case When Category = 'Software' Then Supplier End ) As Software
From MyTable
Group By Location
However, if what you seek is to have a dynamic number of categories (and thus columns), this cannot be done natively in SQL. This later solution is called a dynamic crosstab. The best approach is either to build the SQL statement akin to the static version above in your middle-tier or using a reporting tool which will do the same.