SQL where條件和jion on條件的詳解及區別。本站提示廣大學習愛好者:(SQL where條件和jion on條件的詳解及區別)文章只能為提供參考,不一定能成為您想要的結果。以下是SQL where條件和jion on條件的詳解及區別正文
sql 語句中where條件和jion on條件的區別
與有很大的差異,請留意!
SELECT TBL_SchemaDetail.MaterialNo, TBL_StockMaterial.SalePrice FROM TBL_StockMaterial RIGHT OUTER JOIN TBL_SchemaDetail ON TBL_StockMaterial.MaterialNo = TBL_SchemaDetail.MaterialNo AND TBL_SchemaDetail.SchemaNo = '7411' AND TBL_StockMaterial.SalePrice = 0
條件全部放到join的on中。
SELECT TBL_SchemaDetail.MaterialNo, TBL_StockMaterial.SalePrice FROM TBL_StockMaterial RIGHT OUTER JOIN TBL_SchemaDetail ON TBL_StockMaterial.MaterialNo = TBL_SchemaDetail.MaterialNo WHERE (TBL_SchemaDetail.SchemaNo = '7411') AND (TBL_StockMaterial.SalePrice = 0)
銜接和條件分開。
感激閱讀,希望能協助到大家,謝謝大家對本站的支持!