I have 3 table in a mysql database,category,product and cat_pro,category table contains categories,products table contain products and their prices,cat_pro contain the primary keys of categories and products respectively.A category can contain numerous products. Category table has category_id and category name,products table has product_id,product_name and price.cat_pro table is used during inner joins since it contains the foreign keys of categories and products.
What i want is an sql query statement that outputs a category followed by the products in that category together with their prices until all the categories and products are exhausted in a vertical manner. The problem is outputting the information in the manner below.That is a category followed by its products For example
Category A
product 1 250$
product 2 450$
Category B
product 1 100$
product 2 400$
Category C
product 1 300$
product 2 100$