表名:ZL_CartProView

简要说明:

ZL_CartProView

GO

CREATE VIEW [dbo].[ZL_CartProView] AS

SELECT A.ID AS CartID,A.PClass,A.ProID,A.ProName,A.Shijia,A.Pronum,A.AddStatus,A.AllMoney,A.StoreID,A.Thumbnails,A.GuessXML --ZL_CartPro

,B.Freight,B.ID,B.OrderNo,B.AddUser,B.AddTime,B.OrderStatus,B.PaymentStatus,B.OrdersAmount,B.StateLogistics,B.Aside,B.Delivery,B.Service_charge --ZL_OrderInfo

,B.OrderType,B.OrderMessage,B.Receivablesamount,B.ExpressNum,B.PaymentNo,B.IsCount,B.IsSure,B.Settle

,B.Shengfen,B.Jiedao,B.ZipCode,B.MobileNum,B.Phone,B.Email,B.Receiver,B.Rename,B.ExpressDelivery

,B.UserID,B.ParentUserID,B.HoneyName --ZL_User

,B.ExpSTime   --ZL_Exp

,PM.PayType FROM --ZL_Payment

(SELECT A.*,B.LinPrice,B.Thumbnails,B.GuessXML,B.ProCode FROM ZL_CartPro A LEFT JOIN ZL_Commodities B ON A.ProID=B.ID)AS A

LEFT JOIN 

(SELECT A.*,B.ParentUserID,B.HoneyName,ZL_Order_Exp.CDate AS ExpSTime FROM ZL_OrderInfo A LEFT JOIN ZL_User B ON A.UserID=B.UserID LEFT JOIN ZL_Order_Exp ON A.ExpressNum=ZL_Order_Exp.ID) AS B

ON A.Orderlistid=B.ID

LEFT JOIN ZL_PayMent PM

ON B.PaymentNo=PM.PayNo


--注意:将清空全表数据

detele from ZL_CartProView

--注意:将删除整个表

drop table ZL_CartProView

--注意:清空且复位表ID序列为初始值

TRUNCATE table ZL_CartProView