create view_test as select ... as ..., ... as ..., ... from tb
create view [视图名] as [查询语句]关键是写出这句查询语句,要给出与TCL_CMS_VideoColumn表关联的其他表的表结构及字段说明, 否则不知如何帮你写喔.
insert into TCL_TPSV_Class(ID,Title,ParentID,Level,contentNum,Ctype,PathTitle,ClassOrder,ClassHidden,AppDeviceTypes,Entitle,EnPathTitle) select id,name,parentColumnId,ColLevel, (select count(*) from 关联表 where columnid=a.id) as contentNum, colType, (select top 1 name from TCL_CMS_VideoColumn where id=a.ParentColumnId)+name as pathtitle, colOrder,ColHidden,Appdevice,EnName, (select top 1 Enname from TCL_CMS_VideoColumn where id=a.ParentColumnId)+Enname as EnPathTitle from TCL_CMS_VideoColumn a
select ... as ...,
... as ...,
...
from tb
create view [视图名]
as
[查询语句]关键是写出这句查询语句,要给出与TCL_CMS_VideoColumn表关联的其他表的表结构及字段说明,
否则不知如何帮你写喔.
select id,name,parentColumnId,ColLevel,
(select count(*) from 关联表 where columnid=a.id) as contentNum,
colType,
(select top 1 name from TCL_CMS_VideoColumn where id=a.ParentColumnId)+name as pathtitle,
colOrder,ColHidden,Appdevice,EnName,
(select top 1 Enname from TCL_CMS_VideoColumn where id=a.ParentColumnId)+Enname as EnPathTitle
from TCL_CMS_VideoColumn a
结贴了