我想将两个表的结果组合在一起,因为当我分开做时,我得到 NULLS
这是我的代码
DECLARE @origSiteID int = 836,
@NewSiteID int = 838
SELECT tblControls_Rooms.ID, @origSiteID
FROM tblControls_Rooms
WHERE SiteID = @OrigSiteID
SELECT tblControls_Rooms.ID, @NewSiteID
FROM tblControls_Rooms
WHERE SiteID = @newSiteID
当我运行它时:
ID (No column name)
1942 836
1943 836
1944 836
1945 836
1946 836
和
ID (No column name)
2025 838
2026 838
2027 838
2028 838
我希望结果是:
ID (No column name)
1942 836
1943 836
1944 836
1945 836
1946 836
2025 838
2026 838
2027 838
2028 838