cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to get the product models from two different catalog IDs having common product codes using flexible query?

Former Member
0 Likes
612

Hi Experts,

I want to write a query to fetch the product models belonging in two different catalogs but having same product codes.

Any help would be appreciated !

Thanks,

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Likes

select {code} from {Product} where {catalogVersion}='8796125989417' AND IN ({{select {code} from {Product} where {catalogVersion}='8746575588799'}})

8796125989417 Pk of catalogVersion 1

8746575588799 Pk of catalogVersion 2

0 Likes

Here is a query you can try out to get the result

select {p.code}, {cv.version}, {c.id} from {Product as p}, {CatalogVersion as cv}, {Catalog as c} where {p.catalogVersion} = {cv.pk} and {cv.catalog} = {c.pk} and {p.code} = 'your_common_product_code'

former_member674349
Participant
0 Likes

hi pratik, you can use IN and groupby clause. please find below query for refernece select {code},count({code}) from {product} where {catalog} in (catalog1 pk,catalog2 pk and so on..) group by {code}