MC
А потом все три запроса объединяете UNION
Size: a a a
MC
А
select goods.name```
from goods
inner join prices ON prices.id = goods.id
where discount = 10
UNION ALL
select manufactures.name
from manufactures
inner join goods ON goods.manufacturer_id = manufactures.id
inner join prices ON prices.id = goods.id
where discount = 10
UNION ALL
select categories.name
from categories
inner join goods ON goods.category_id = categories.id
inner join prices ON prices.id = goods.id
where discount = 10
MC
select goods.name```
from goods
inner join prices ON prices.id = goods.id
where discount = 10
UNION ALL
select manufactures.name
from manufactures
inner join goods ON goods.manufacturer_id = manufactures.id
inner join prices ON prices.id = goods.id
where discount = 10
UNION ALL
select categories.name
from categories
inner join goods ON goods.category_id = categories.id
inner join prices ON prices.id = goods.id
where discount = 10
🐾M
🐾M
А
🐾M
🐾M
MC
MC
ПЛ
IK
ПЛ
IK
ПЛ
SELECT A.[Имя_компа], B.[Версия], B.[Дата_установки] FROM [Список_машин] as A LEFT JOIN [История_версий] as B
ON (A.[Имя_компа] = B.[Имя_компа])
WHERE B.[Версия] = @Version
ORDER BY A.[Имя_компа]
ПЛ
SELECT A.[Имя_компа], B.[Версия], B.[Дата_установки] FROM [Список_машин] as A LEFT JOIN [История_версий] as B
ON (A.[Имя_компа] = B.[Имя_компа])
WHERE B.[Версия] = @Version
ORDER BY A.[Имя_компа]
V
V
MC
LEFT JOIN B + WHERE B.column
превращает его в INNERWHERE B.[Версия] = @Version OR B.[Версия] IS NULL
ПЛ