0
나는 아래의 쿼리를 사용하지만 오류가 발생합니다 :사용하는 경우, 다른 SQL 쿼리의 기능에
CREATE FUNCTION getCustomerPaymentFunc (@customerCode bigint)
RETURNS bigint AS BEGIN
RETURN
(if(select coun from getCustomerPaymentCount (@customerCode))=0)
select 0 as price
else
(select SUM(price) as code
from PaymentLog
where [email protected])
) END
나는 두 아래 사용을하지만 말한다 : 함수가 데이터를 반환 할 수없는 내
선택 사항이 포함 당신의 의도는 함수가 주어진 customerCode
의 PaymentLog
표에 가격의 합을 반환하거나 경우 0을 반환하는 것입니다 같은 클라이언트에
CREATE FUNCTION getCustomerPaymentFunc (@customerCode bigint)
RETURNS bigint AS BEGIN
RETURN
(
SELECT CASE WHEN (select coun from getCustomerPaymentCount(@customerCode))=0
THEN 0 ELSE 1 END as
(select SUM(price) as code from PaymentLog
where [email protected])
) END
무엇 당신이 말하는 오류 – Marc
오류, 내 어린 파다완? –
질문을 편집했습니다. – SajjadZare