raza1
11-09-2004, 04:32 AM
Hi,
I want below SQL statement to output 4 types of categories in products tbl, belongs to different products. It produce categories but in MULTIPLE times, e.g. scanners, scanners,scanners, printers, printers, systems, systems, systems, systems.
sqlString = "SELECT Category.categoryName, products.pID, products.pDisplay "&_
'"FROM Category INNER JOIN products ON Category.categoryID = products.pCategory "&_
'"Order By Category.categoryName"
I have 2 tbl's 1.Category 2.products.
In Category tbl fields are: categoryId, categoryName, categoryDescription
In products tbl fields are: pID, pName,pCategory,pPrice etc.
[list]Relationship bet. 2 tbls 1-many
pCategory of products tbl getting records from categoryName of Category tbl.
I want below SQL statement to output 4 types of categories in products tbl, belongs to different products. It produce categories but in MULTIPLE times, e.g. scanners, scanners,scanners, printers, printers, systems, systems, systems, systems.
Please help me to amend it, so that it produce each category each time. e.g. scanners, printers, systems
sqlString = "SELECT Category.categoryName, products.pID "&_
'"FROM Category INNER JOIN products ON Category.categoryID = products.pCategory "&_
'"Order By Category.categoryName"
I want below SQL statement to output 4 types of categories in products tbl, belongs to different products. It produce categories but in MULTIPLE times, e.g. scanners, scanners,scanners, printers, printers, systems, systems, systems, systems.
sqlString = "SELECT Category.categoryName, products.pID, products.pDisplay "&_
'"FROM Category INNER JOIN products ON Category.categoryID = products.pCategory "&_
'"Order By Category.categoryName"
I have 2 tbl's 1.Category 2.products.
In Category tbl fields are: categoryId, categoryName, categoryDescription
In products tbl fields are: pID, pName,pCategory,pPrice etc.
[list]Relationship bet. 2 tbls 1-many
pCategory of products tbl getting records from categoryName of Category tbl.
I want below SQL statement to output 4 types of categories in products tbl, belongs to different products. It produce categories but in MULTIPLE times, e.g. scanners, scanners,scanners, printers, printers, systems, systems, systems, systems.
Please help me to amend it, so that it produce each category each time. e.g. scanners, printers, systems
sqlString = "SELECT Category.categoryName, products.pID "&_
'"FROM Category INNER JOIN products ON Category.categoryID = products.pCategory "&_
'"Order By Category.categoryName"