I'm trying to create a product listing. Naturally Sql prints the data vertically forming rows after rows like this:

Rowa. product_img#1|Product_name|Product_price|Product_short_description
Rowb. product_img#2|Product_name|Product_price|Product_short_description
Rowc. product_img#3|Product_name|Product_price|Product_short_description
Rowd. product_img#4|Product_name|Product_price|Product_short_description

and so on...

I'm trying to create a query so that I can display 3 products per rows like this:

Product_img#1|             Product_img#2|            Product_img#3|
Product_name|              Product_name|             Product_name|
Product_price|             Product_price|            Product_price|
Product_description|       Product_description|      Product_description|

Looking up the web I found that what i'm trying to do is called pivot table. It was suggested to me to use a service report like SQL Server Reporting Services and create a Matrix Report to print the data the way I want it.

To be honest, I have no idea how to use those services and where to start... This is totally gibberish to me. I'm using Netbeans joined with Mysql. Where do I install those services and how do I use them?

Is there such kind of service integrated in Workbench? Any help/tricks/tips on how to achieve this would be gladly appreciated!


1 Answer 1


The functionality you are looking for goes under the name UNPIVOT. I'd suggest you have a good search on that subject and post a new question if you have further, specific question.


Not the answer you're looking for? Browse other questions tagged or ask your own question.