Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I've got a question about what's the best way of linking two tables like this:
Table 1 - Sales:
CR_ID | ORD_ID | QTY |
---|---|---|
123 | 456 | 1 |
125 | 456 | 5 |
127 | 567 | 7 |
Table 2- Options
CR_ID | ORD_ID | OPT |
---|---|---|
123 | 456 | a |
123 | 456 | b |
123 | 456 | c |
125 | 456 | a |
127 | 567 | b |
Is this the best solution to link them on CR_ID if people want to report on OPT field? For example, they want to select one or combination of options to see the total QTY or count of orders with this option or particulatr combimation of options.
Thank you in advace,
~Serg
if u want to report on opt field do the right join
table 1:
table2:
right join(table 1)
by doing this u will get all the opt values ...
or else if u want all the combination just get rid right and it will be a outer join.......
table 1:
table2:
join(table 1)
Hi,
Thanks for the quick reply.
But what if I just do "Unqualify CR_ID;" in both tables? Will it be enought?
Best Regards,
Serg