SQL添加视图

/*定义视图名称*/
create view NoImgProduct
as
/*定义视图内容*/
select
ProductNo,ProductName,ProductImg,Description,
img1,Stock,CommonNumber,WarehouseName,Position
from
dbo.Product,ZtdGoodsStock,WarehouseServiceCharge,SubWarehouse
where
Product.ProductID=ZtdGoodsStock.ProductID
and product.ProductID=WarehouseServiceCharge.ProductId
and WarehouseServiceCharge.ZtdID=282
and ZtdGoodsStock.ZtdNo='A001'
and ZtdGoodsStock.Stock>0
and img1='none.gif'
and SubWarehouse.WID=WarehouseServiceCharge.WID
/*加上约束语句,以后对视图进行插入、修改和删除操作时,会自动加上where后面的条件*/

原文地址:https://www.cnblogs.com/webwangjie/p/11157548.html