问题出在我的选择语句中:
SELECT
Kolonminhas.KolonminhaID
,Kolonminhas.KolonID AS [Kolonminhas KolonID]
,Kolonminhas.Aciklama
,Kolonminhas.En AS [Kolonminhas En]
,Kolonminhas.Boy AS [Kolonminhas Boy]
,Kats.KatID AS [Kats KatID]
,Kats.BlokID AS [Kats BlokID]
,Kats.Ad AS [Kats Ad]
,Kats.Kolonaltkot
,Kats.Kolonustkot
,Bloks.BlokID AS [Bloks BlokID]
,Bloks.ProjectID
,Bloks.Ad AS [Bloks Ad]
,Kolons.KolonID AS [Kolons KolonID]
,Kolons.KatID AS [Kolons KatID]
,Kolons.KolonAdi
,Kolons.En AS [Kolons En]
,Kolons.Boy AS [Kolons Boy]
,Kolons.Yukseklik
,Kolons.Altkot
,Kolons.UstKot
FROM
Kolons
INNER JOIN Kolonminhas
ON Kolons.KolonID = Kolonminhas.KolonID
INNER JOIN Kats
ON Kolons.KatID = Kats.KatID
INNER JOIN Bloks
ON Kats.BlokID = Bloks.BlokID
要解决此问题,应使用 OUTER JOIN 命令。但是我无法创建一个。如果有人帮助我,我将不胜感激。
这是正确的查询:
SELECT
Kolonminhas.KolonminhaID
,Kolonminhas.KolonID AS [Kolonminhas KolonID]
,Kolonminhas.Aciklama
,Kolonminhas.En AS [Kolonminhas En]
,Kolonminhas.Boy AS [Kolonminhas Boy]
,Kats.KatID AS [Kats KatID]
,Kats.BlokID AS [Kats BlokID]
,Kats.Ad AS [Kats Ad]
,Kats.Kolonaltkot
,Kats.Kolonustkot
,Bloks.BlokID AS [Bloks BlokID]
,Bloks.ProjectID
,Bloks.Ad AS [Bloks Ad]
,Kolons.KolonID AS [Kolons KolonID]
,Kolons.KatID AS [Kolons KatID]
,Kolons.KolonAdi
,Kolons.En AS [Kolons En]
,Kolons.Boy AS [Kolons Boy]
,Kolons.Yukseklik
,Kolons.Altkot
,Kolons.UstKot
from Bloks
left join (Kats left join (Kolons left join Kolonminhas on Kolons.KolonID = Kolonminhas.KolonID) ON Kats.KatID = Kolons.KatID) ON Bloks.BlokID = Kats.BlokID