我用來在side select子句中編寫select子句以避免從from子句中加入。但是,我擔心這是一個很好的相關練習,否則會降低數據庫的性能。下面是包含多個表的查詢,但是我用沒有任何聯接語句的嵌套select子句寫了它。請讓我知道如果我犯了什麼錯誤或沒有問題。此時此刻,我正在得到準確的結果。嵌套select子句是否會降低數據庫性能?
SELECT * ,
(select POrderNo from PurchaseOrderMST POM
where POM.POrderID=CET.POrderID)as POrderNo,
(select SiteName from SiteTRS ST where ST.SiteID=CET.SiteID)as SiteName,
(select ParticularName from ParticularMST PM where
PM.ParticularID=CET.ParticularID)as ParticulerName
FROM ClaimExpenseTRS CET
WHERE [email protected]
可能的重複:http://stackoverflow.com/questions/1067016/join-queries-vs-multiple-queries –