SQL server数据库 ,在视图里面新加一个列怎么加
CREATEVIEW[dbo].[CWDomesticCard]ASSELECT*FROMERAS2NONAML.eRASNonAML_DEV.dbo.CWDomesti...
CREATE VIEW [dbo].[CWDomesticCard]
AS
SELECT *
FROM ERAS2NONAML.eRASNonAML_DEV.dbo.CWDomesticCard AS CWDomesticCard_1
这个是视图的语句,我不怎么看的懂 有大神吗? 展开
AS
SELECT *
FROM ERAS2NONAML.eRASNonAML_DEV.dbo.CWDomesticCard AS CWDomesticCard_1
这个是视图的语句,我不怎么看的懂 有大神吗? 展开
1个回答
展开全部
视图的语句就是你的select查询语句前面追加一个定义的前缀。
你要多加一个列,就直接改后边的select语句即可
如:多增加一个时间的字段列f1,一个数字列f2,一个字符串的字段f3
CREATE VIEW [dbo].[CWDomesticCard]
AS
SELECT *,getdate() as f1,30 as f2,'ABC' AS F3
FROM ERAS2NONAML.eRASNonAML_DEV.dbo.CWDomesticCard AS CWDomesticCard_1
你要多加一个列,就直接改后边的select语句即可
如:多增加一个时间的字段列f1,一个数字列f2,一个字符串的字段f3
CREATE VIEW [dbo].[CWDomesticCard]
AS
SELECT *,getdate() as f1,30 as f2,'ABC' AS F3
FROM ERAS2NONAML.eRASNonAML_DEV.dbo.CWDomesticCard AS CWDomesticCard_1
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询