MySQL Forums
Forum List  »  General

JOIN
Posted by: Robert Kehl
Date: December 04, 2020 04:38PM

Hello,
I have the following problem, which could maybe solved by sql-join.

1. objective: get all combinations of 2 variables
2. example
---------------------------------

create table basis
(article Integer,
supplier VarChar(10) );

Insert into basis
Values(4711, 'A'),
(4712, 'B'),
(4712, 'C'),
(4712, 'D'),
(4713, 'C'),
(4713, 'E');

------------------------

3. following result is expected

combination_nr;article;supllier
1;4711;'A'
1;4712;'B'
1;4713;'C'
2;4711;'A'
2;4712;'B'
2;4713;'E'
2;4711;'A'
3;4712;'C'
3;4713;'C'
4;4713;'A'
4;4713;'D'
4;4713;'E'
5;4713;'A'
5;4713;'D'
5;4713;'C'
6;4713;'A'
6;4713;'D'
6;4713;'E'

Thanks in advance

Options: ReplyQuote


Subject
Written By
Posted
JOIN
December 04, 2020 04:38PM
December 05, 2020 10:13AM
December 05, 2020 01:54PM
December 05, 2020 02:43PM
December 05, 2020 04:21PM
December 06, 2020 06:39AM
December 06, 2020 11:36AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.