Table 1
| Customer_ID | Template_ID --------------------- | C1 | T1 | | C1 | T2 | --------------------- Table 2
--------------------- | Template_ID | Product_ID --------------------- | T1 | P1 | | T1 | P5 | | T1 | P5 | | T2 | P10 | | T2 | P45 | Expected Join query result:
------------------------------------------ | Customer_ID | Template_ID | Product_ID ------------------------------------------ | C1 | T1 | P1 | C1 | T1 | P5 | C1 | T2 | P10 | C1 | T2 | P45 . . For a template, I want to get only the unique Product_ID like above. Currently my query returns P5 twice like,
. . | C1 | T1 | P5 | C1 | T1 | P5 . . How can I handle this at the query level?
Table2?