gpt4 book ai didi

tsql - 关键字 'as' 附近的语法不正确,但行没有 'as'

转载 作者:行者123 更新时间:2023-12-04 05:16:16 24 4
gpt4 key购买 nike

我正在更改存储过程,当我尝试执行时,我得到:

Msg 156, Level 15, State 1, Procedure vtg_asmbltimephasedashassy, Line 20  
Incorrect syntax near the keyword 'AS'

但是当我转到第 20 行时,没有关键字 'as',也没有出现在第 20 行之前或之后的行中。也许我计算的行数有误。

当我数到第 20 行时,我得到的行是
jobmtl.partnum=partwhse.partnum FULL OUTER JOIN  

谁能指出我正确的方向,因为我需要做些什么来解决这个问题?我的整个存储过程如下。
USE [mfgsys803]
GO
/****** Object: StoredProcedure [dbo].[vtg_asmbltimephasedashassy] Script Date: 01/08/2013 12:59:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER proc [dbo].[vtg_asmbltimephasedashassy] @p_plant varchar(max)
as
begin
set nocount on;

SELECT jobhead.jobnum, sum(partwhse.onhandqty) as 'onhandqty', jobhead.partnum, jobhead.revisionnum, jobhead.prodqty, jobhead.startdate, jobhead.duedate, jobhead.reqduedate,
jobhead.commenttext, jobmtl.issuedcomplete, jobmtl.issuedqty, jobmtl.mtlseq, jobmtl.partnum AS 'mtlpart', jobmtl.requiredqty, jobmtl.qtyper, jobmtl.reqdate,
partwhse.warehousecode, prodgrup.description
FROM jobmtl LEFT OUTER JOIN
partwhse INNER JOIN
warehse ON partwhse.company = warehse.company AND partwhse.warehousecode = warehse.warehousecode ON jobmtl.company = partwhse.company AND
jobmtl.partnum = partwhse.partnum FULL OUTER JOIN
prodgrup INNER JOIN
jobhead ON prodgrup.company = jobhead.company AND prodgrup.prodcode = jobhead.prodcode ON jobmtl.company = jobhead.company AND
jobmtl.jobnum = jobhead.jobnum
WHERE (jobhead.jobreleased = 0) AND (jobhead.jobfirm = 1) AND (jobhead.jobengineered = 1) AND (jobhead.company = 'lot') and (prodgrup.description like '%assy%') and (jobhead.plant=@p_plant) and (warehse.plant=@p_plant)

group by jobhead.jobnum, jobhead.partnum, jobhead.revisionnum, jobhead.prodqty, jobhead.startdate, jobhead.duedate, jobhead.reqduedate,
jobhead.commenttext, jobmtl.issuedcomplete, jobmtl.issuedqty, jobmtl.mtlseq, jobmtl.partnum AS 'mtlpart', jobmtl.requiredqty, jobmtl.qtyper, jobmtl.reqdate,
partwhse.warehousecode, prodgrup.description


end

最佳答案

将这部分从组中删除

jobmtl.partnum AS 'mtlpart'

让它
jobmtl.partnum 

关于tsql - 关键字 'as' 附近的语法不正确,但行没有 'as',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14222650/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com