try:create view addview
as
select pd_3.票号,pd_3.sep,pd_3.物料编号,pd_3.物料名称,pd_3.单位,pd_3.工厂,pd_3.楼层,pd_3.仓库,pd_3.盘点量,pd_3.成本价
from pd_3
where ltrim(rtrim(pd_3.物料编号)) not in (select ltrim(rtrim(物料编号))from pd_31)

解决方案 »

  1.   

    问题还是没有解决,好是提示错误!
    Server: Msg 170, Level 15, State 1, Procedure addview, Line 10
    Line 10: Incorrect syntax near 'pd_3'.
    唉,真不怎么办,我才刚刚开始学SQL就有这些麻烦,真是让我有点灰心,我在PD_3再加多一列做CHK,写了一语句update pd_3 set chk='1'where pd_3.物料编号=pd_31.物料编号
    消息提示错误:Server: Msg 107, Level 16, State 3, Line 1
    The column prefix 'pd_31' does not match with a table name or alias name used in the query.