SQL where条件和jion on条件的详解及区别
时间:2021-02-09 14:32:22|栏目:MsSql|点击: 次
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)
连接和条件分开。
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
上一篇:ACCESS数据库的压缩,备份,还原,下载,删除的实现
栏 目:MsSql
本文标题:SQL where条件和jion on条件的详解及区别
本文地址:http://www.codeinn.net/misctech/59714.html