on ‎2019 Jun 20 10:33 PM
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,
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.