I have a table (in MySQL) with 3 columns:
Location Category Supplier
A Computers Company X
A Printers Company Y
B
I have no way to check if the query is fine, but more or less would be a query like this:
SELECT t1.Location, MAX(t1.Computers), MAX(t1.Printers), MAX(t1.Software)
FROM (
SELECT
t.Location,
CASE WHEN t.Category = 'Computers' THEN
t.Supplier
END Computers,
CASE WHEN t.Category = 'Printers' THEN
t.Supplier
END Printers,
CASE WHEN t.Category = 'Software' THEN
t.Supplier
END Software,
FROM
YOUR_TABLE t
) t1
GROUP BY t1.Location