sql 2000 查询分析器中
这个语句没错
select A.bom_id,A.wl_id,A.ssn_id,A.col_id,
POD_number=sum(isnull(A.POD_number,0)*isnull(B.uc_number,1))
from (select A.bom_id,A.PO_id,A.PO_editid,A.wl_id,A.ssn_id,A.col_id,
A.POD_number,A.ctc_id1
from dbo.POD A
left join wl B on A.wl_id=B.wl_id
left join maxpo_view C on A.PO_id=C.PO_id and A.PO_editid=C.PO_editid
where isnull(C.po_state,0)<3 and C.po_id is not null and A.bom_id is not null) A
left join wl C on A.wl_id=C.wl_id
left join unitchenge B on A.ctc_id1=B.ctc_id and C.wl_cgctc=B.ctc_newid
group by A.bom_id,A.wl_id,A.ssn_id,A.col_id下面这样就报错:Server: Msg 8624, Level 16, State 3, Line 1
Internal SQL Server error.select X.*
from (select A.bom_id,A.wl_id,A.ssn_id,A.col_id,
POD_number=sum(isnull(A.POD_number,0)*isnull(B.uc_number,1))
from (select A.bom_id,A.PO_id,A.PO_editid,A.wl_id,A.ssn_id,A.col_id,
A.POD_number,A.ctc_id1
from dbo.POD A
left join wl B on A.wl_id=B.wl_id
left join maxpo_view C on A.PO_id=C.PO_id and A.PO_editid=C.PO_editid
where isnull(C.po_state,0)<3 and C.po_id is not null and A.bom_id is not null) A
left join wl C on A.wl_id=C.wl_id
left join unitchenge B on A.ctc_id1=B.ctc_id and C.wl_cgctc=B.ctc_newid
group by A.bom_id,A.wl_id,A.ssn_id,A.col_id) X
这个语句没错
select A.bom_id,A.wl_id,A.ssn_id,A.col_id,
POD_number=sum(isnull(A.POD_number,0)*isnull(B.uc_number,1))
from (select A.bom_id,A.PO_id,A.PO_editid,A.wl_id,A.ssn_id,A.col_id,
A.POD_number,A.ctc_id1
from dbo.POD A
left join wl B on A.wl_id=B.wl_id
left join maxpo_view C on A.PO_id=C.PO_id and A.PO_editid=C.PO_editid
where isnull(C.po_state,0)<3 and C.po_id is not null and A.bom_id is not null) A
left join wl C on A.wl_id=C.wl_id
left join unitchenge B on A.ctc_id1=B.ctc_id and C.wl_cgctc=B.ctc_newid
group by A.bom_id,A.wl_id,A.ssn_id,A.col_id下面这样就报错:Server: Msg 8624, Level 16, State 3, Line 1
Internal SQL Server error.select X.*
from (select A.bom_id,A.wl_id,A.ssn_id,A.col_id,
POD_number=sum(isnull(A.POD_number,0)*isnull(B.uc_number,1))
from (select A.bom_id,A.PO_id,A.PO_editid,A.wl_id,A.ssn_id,A.col_id,
A.POD_number,A.ctc_id1
from dbo.POD A
left join wl B on A.wl_id=B.wl_id
left join maxpo_view C on A.PO_id=C.PO_id and A.PO_editid=C.PO_editid
where isnull(C.po_state,0)<3 and C.po_id is not null and A.bom_id is not null) A
left join wl C on A.wl_id=C.wl_id
left join unitchenge B on A.ctc_id1=B.ctc_id and C.wl_cgctc=B.ctc_newid
group by A.bom_id,A.wl_id,A.ssn_id,A.col_id) X
create view ss
as
select A.bom_id,A.wl_id,A.ssn_id,A.col_id,
POD_number=sum(isnull(A.POD_number,0)*isnull(B.uc_number,1))
from (select A.bom_id,A.PO_id,A.PO_editid,A.wl_id,A.ssn_id,A.col_id,
A.POD_number,A.ctc_id1
from dbo.POD A
left join wl B on A.wl_id=B.wl_id
left join maxpo_view C on A.PO_id=C.PO_id and A.PO_editid=C.PO_editid
where isnull(C.po_state,0)<3 and C.po_id is not null and A.bom_id is not null) A
left join wl C on A.wl_id=C.wl_id
left join unitchenge B on A.ctc_id1=B.ctc_id and C.wl_cgctc=B.ctc_newid
group by A.bom_id,A.wl_id,A.ssn_id,A.col_id
select X.*
from ss X
Internal SQL Server error在网站上查了下是SQL内部错误!!!
DBCC CHECKTABLE ('表名')WITH ALL_ERRORMSGS
DBCC CHECKTABLE ('视图名') WITH ALL_ERRORMSGS
试试看有没有错误提示