Multi join on same table

C

cedric

Dear All,

i ve got table

Catalogue
|ProductType |ProductCode |
| A | 10 |
A | 12 |

Products
|ProductType | ProductCode |ProductCodeRef |
| A | 10 | |
| A | 11 | |
| A | 12 | |
| V | V1_10 | 10 |
| V | V2_10 | 10 |
| S | S_11 | 11 |
| S | S_V1_10 | V1_10 |


in table Products I can have 3 productTypes A, S, V
A is BaseType
V is Version of productCode
S is Substitute of Product or Version

I want to get all ProductCode and Version and SubstituteCode from
Products that match with Catalogue
for base product 10 and 12
the result must be
| productType | ProductCode |
| A | 10 |
| A | 12 |
| V | V1_10 |
| V | V2_10 |
| S | S_V1_10 |

I don't know how to do this queries
Could you help me

Thx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top