要从ClientBInfo 和SellsInfo 2个表中选出下面字段建一个视图,怎么弄?
CACC,Name,LabelNo,Sstere,Samt,GrossTotal,ReceiveTotal,Sdate,CbuinCode
创建的命令打在哪里
希望把具体过程说下?需要哪些控件等等?
CACC,Name,LabelNo,Sstere,Samt,GrossTotal,ReceiveTotal,Sdate,CbuinCode
创建的命令打在哪里
希望把具体过程说下?需要哪些控件等等?
as
select * from TableA,TableB
as
select CACC,Name,LabelNo,Sstere,Samt,GrossTotal,ReceiveTotal,Sdate,CbuinCode from ClientBInfo,SellsInfo
as
select * from TableA,TableB
”
SQL Create View
http://keke197607.blog.163.com/blog/static/9674530920094510244367/
AS SELECT First_Name, Last_Name, Country
FROM Customer
上面的语句输入在哪里??
可以用 with ADOQuery1 do
begin
Close;
SQL.Clear;
SQL.Add('CREATE VIEW V_Customer AS SELECT First_Name, Last_Name, Country FROM Customer ');
ExecSQL;
end;随便写在哪里,执行过一次就成功行了,然后可以删除这段代码,我没用过这种方法,你试试。
as
select * from TableA,TableB
指SQL查询分析器里,上面讲过多次了没有可以用10楼的方法试试。
我 在 SQL查询分析器里输入
create view 视图名
as
select CACC,Name,LabelNo,Sstere,Samt,GrossTotal,ReceiveTotal,Sdate,CbuinCode from ClientBInfo,SellsInfo 显示错误:“ClientBInfo,SellsInfo”无效
GO
SET ANSI_NULLS ON
GOCREATE VIEW dbo.test
AS
select a.empno,b.empno from tableA a, tableB bGO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
as
select a.cola,a.colb,b.colc from tableA a inner join tableB on a.cola = b.colb
表ClientBInfo
CACC(编号) Name ID Address Phone OpenBuCode OpenOpCode OpenDate LogOpCode LogDate LgOutBuCode CreateBy CreateDate ModBy ModDate AIndicator
表SellsInfo
Seq Sdate CACC CbuinCode MeterNo LabelNo MeterType MeterModel Samt Sstere SopertCode SbusinCode Ptype IsPayment PurTimes Purproduct ChargePro chargeProjNum BalMode OpTypeCode OpInCode Re ICNo IDNo Rate VAT beforebalance GrossTotal nowbalance ReceiveTotal OtherCharge OIndicator我要从中选出CACC,Name,LabelNo,Sstere,Samt,GrossTotal,ReceiveTotal,Sdate,CbuinCode 创建视图!怎么弄啊?
as
select b.CACC,A.Name,b.LabelNo,b.Sstere,b.Samt,b.GrossTotal,b.Receivetotal,b.Sdate,b.CbuinCode
from clientbinfo a,sellsinfo b
where a.CACC=b.CACC
看看你的表建在哪个表空间里了,前面可以加上前缀 如dbo.user
如“dbo.user.ClientBInfo”??
这样没有用