我被告知刪除工會並將查詢的上半部分改爲一個,我被告知這很容易,但我無法弄清楚。有人告訴我,這將包括像從查詢中刪除聯合並將其轉換爲一個查詢?
凡紅(主要顏色)=紅(SilksName) 凡藍(主要顏色)=藍(SilksName) 等
Select S.[Silks_Skey]
from [dbo].[Silks] S
inner join [dbo].[SubColour] SC on CHARINDEX(SC.[SubColour],S.[SilksName]) <> 0
inner join [dbo].[MajorColour] MC on SC.[MajorColour] = MC.[MajorColour]
UNION ALL
Select S.[Silks_Skey], MC.[MajorColour_Skey]
from [dbo].[Silks] S
inner join [dbo].[MajorColour] MC on CHARINDEX(MC.[MajorColour],S.[SilksName]) <> 0
ORDER BY S.[Silks_Skey]
這聽起來像你應該特別提出的** **誰告訴你「刪除工會」,並且「這很容易」,並且「它將包括類似於......的東西......」 – AakashM 2013-05-03 10:04:20