Answer the question
In order to leave comments, you need to log in
How to build a table based on existing ones?
There is such a structure of tables, how to build a new table with supplier numbers and pairs of part numbers, such that some supplier supplies both specified parts. At the same time, pairs of the form 1 and 2, as well as 2 and 1, are considered the same?
Answer the question
In order to leave comments, you need to log in
If I understand correctly, then all possible pairs of parts that are supplied by one supplier
SELECT t1.Snum, t1.Pnum, t2.Pnum FROM `spj` as t1
join spj as t2 on t1.Snum = t2.Snum and t1.Pnum != t2.Pnum
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question