Title: Find not possible combinations of rows & columns
Tags: sql;sql-server
Question: Based on SQL Server, I have multiple rows with multiple columns. Each row contains a product-configuration which is different in at least one column. Now I need to know which are the not existing configurations. The three columns are only an example to make it easier to understand.
An example of data:
Product
Yellow
As a result, those configurations are missing:
Product
Yellow
Yellow

Here is the accepted answer: Gordon's answer doesn't take into account nullable columns, here is one that does:
select p.product, s.size, c.color
from (select distinct product from t) p cross join
(select distinct size from t) s cross join
(select distinct color from t) c
except
select t.product, t.size, t.color
from t;
If you have actual product, size and color tables, it will be more performant to use those instead of select distinct... from t
Comment for this answer: FWIW: the answer from Gordon Linoff is standard SQL that is widely supported. `EXCEPT` is not supported by all DMBS.
Comment for this answer: Also i would assume `product` can not be NULL, so it really doesn't make any difference.
Comment for this answer: @Kaii I don't believe that is true see https://stackoverflow.com/questions/26060151/ansi-sql-standard-for-oracle-minus-keyword

Here is another answer: You can use cross join to generate all the rows.  Then filter out the ones that exist:
select p.product, s.size, c.color
from (select distinct product from t) p cross join
(select distinct size from t) s cross join
(select distinct color from t) c left join
t
on p.product = t.product and
s.size = t.size and
c.color = t.color
where t.product is null;

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2021:00:02/17/21', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<sql><sql-server>', 'Title': 'Find not possible combinations of rows & columns', 'ViewCount': 40, 'id': 66243756, 'user_AboutMe': '', 'user_AccountId': 1264345.0, 'user_DisplayName': 'Fantasterei', 'user_Reputation': 455.0, 'user_Views': 30.0, 'user_id': 1221992.0}}