表名:ZL_Plat_BlogView

简要说明:

ZL_Plat_BlogView

GO

CREATE VIEW  [dbo].[ZL_Plat_BlogView] AS

SELECT 

CateID=0,CateName='',ID,Pid,ReplyID,MsgType,Title,MsgContent,ReplyUserID,ColledIDS,LikeIDS,[Status],CUser,CUName,CDate,

GroupIDS,[Attach],EndTime,VoteOP,VoteResult,ForwardID,ATUser,CompID,

ReplyUName,Location,Source='plat',ReadNumber

FROM ZL_Plat_Blog Union ALL 


SELECT A.Cateid,A.CateName,-B.ID AS ID,-B.Pid AS Pid,-B.ReplyID AS ReplyID,MsgType,Title,MsgContent,ReplyUserID,ColledIDS,LikeIDS,B.[Status],CUser,CUName,CDate,

GroupIDS='',[Attach]='', EndTime='2016-09-14 18:29:21.123',VoteOP='',VoteResult='',ForwardID=0,ATUser='',IsPlat AS CompID,

ReplyUName=CUName,Location='',Source='bar',ReadNumber=0 FROM ZL_Guestcate A LEFT JOIN ZL_Guest_Bar B ON A.Cateid=B.CateID

WHERE A.IsPlat>0 AND B.[Status]=99


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

detele from ZL_Plat_BlogView

--注意:将删除整个表

drop table ZL_Plat_BlogView

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

TRUNCATE table ZL_Plat_BlogView