I'm writing a program that displays products and the stores at which they can be located.
So far, I've been able to write an SQL query that displays data as follows:
Product Availability
Milk Store1
Candy Store1
Eggs Store1
Milk Store2
Eggs Store2
Candy Store3
Eggs Store3
Is there any SQL query I can use to have the products grouped on the Product column and the stores at which they can be located expanded into 3 columns as illustrated below?
Product Store1 Store2 Store3
Milk Yes Yes No
Candy Yes No Yes
Eggs Yes Yes Yes