Carl
Carl

Reputation: 1

Flexible Search Query to extract all products, respective ClassificationClass, ClassificationAttribute and Feature if applicable

SELECT {p.code},{p.name}, {c.code}
FROM {Product as p}, {CategoryProductRelation as cpr}, {ClassificationClass as c}, {CatalogVersion as     cv}, {Catalog as cat}
WHERE {p.pk}={cpr.target} 
AND {c.pk}={cpr.source} 
AND {p.catalogversion}={cv.PK} 
AND {cv.catalog}={cat.PK} 
AND {cat:id}='MYCATALOG' 
AND {cv.version}='Staged' 

here's an example of what im trying to achieve:

table

if theres a ProductFeature to display it will show a result, if there isnt one to display it will show null in the p_feature field. Reason for this is I still want to know what Class and Attribute are assigned to the product even if there is no Feature relation

THe closest i got was returning results of all products that have a ProductFeature

Upvotes: 0

Views: 44

Answers (0)

Related Questions