-1
Alter Procedure sp_Member(
@comcode int = 0,
@SubComCode int = 0
)
as
begin
set nocount on
If @comcode= 0
begin
select
(select sum(amount)
from tbcoudet
where memcode=tbm.memcode and expyear=(select max(expyear) from tbexpyear)
and exists(select itemcode
from tbitem
where [email protected] and
[email protected] and
itemcode=tbcoudet.itemcode
)
group by memcode,expyear
)'TurnOver'
, * into #subodh from tbmember tbm where can_flag='N'
end
If @SubComCode= 0
begin
Insert into #subodh
select
(select sum(amount)
from tbcoudet
where memcode=tbm.memcode and expyear=(select max(expyear) from tbexpyear)
and exists(select itemcode
from tbitem
where [email protected] and
itemcode=tbcoudet.itemcode
)
group by memcode,expyear
)'TurnOver'
, * from tbmember tbm where can_flag='N'
end
select top 10 * from #subodh where TurnOver is not null order by TurnOver desc
end
내 문제는 내가 그 다음 내가 오류에 geting EXEC sp_Member @comcode='1',@subcomcode='1'
또는 select top 10 * from #subodh where TurnOver is not null order by TurnOver
이 쿼리를 실행하기 위하여려고 할 때이다 "잘못된 개체 이름 '#subodh'을." 제발 왜 내가이 오류가 geting 오전 및 어떻게 해결할 수 있습니다 ... 제발잘못된 개체 이름 '#subodh은'