Skip to Content
Former Member
Mar 28, 2019 at 11:57 AM

How can we write a query to retrieve distinct Products from two catalogs


Hi Experts,

I'm having two catalogs suppose a,b.....which are having some common and different products(based on material code). Now I need to write one query to get pk's of products from both catalogs without any duplicates (based on material code).I have written the below query to get all the products from a,b.How can we modify it so that no duplicate products based on product code will get retrieved.

SELECT {} FROM {Product AS p JOIN ArticleApprovalStatus as s ON {p.approvalstatus}={} and {s:code}='approved' JOIN CatalogVersion AS cv ON {p.catalogVersion}={} JOIN Catalog AS cat ON {}={cat.activeCatalogVersion}} where {} = 'a' or {} = 'b'

Appreciate any responses.