Предполагая, что у меня есть 2 таблицыMySQL внутреннее соединение с нулевыми столбцами
Table a
brand Fruit edible color size
farmers banana yes yellow null
fresh banana yes red 10
bounty banana null green 2
farmers apple yes red 5
organic grapes null violet 5
love strawberry yes null 5
flow lavander no null null
Table b
boxId fruit edible color size
10100 banana yes yellow 9
19299 banana yes red 10
10992 apple yes red 5
10299 grapes yes red 5
01929 lavander no violet 3
возможно присоединиться Таблица а и б даже с правилом, что: если есть нулевые значения, продолжают оценивать оставшиеся столбцы, пропуская null колонка.
select a.brand, b.boxId from a prod
inner join b box on a.fruit = b.fruit
where a.edible = b.edible and
a.color = b.color and
a.size = b.size
brand boxID
farmers 10100
fresh 19299
. . .
Что вы имеете в виду нулевой? все поля, если только пустое или определенное поле? –
все поля есть нуль – Led
Несомненно, это то, что LEFT [OUTER] JOIN для – Strawberry