[Homework] Functions, Triggers and Transactions - Problem 10. People with Balance Higher Than
Някаква идея защо това не минава в judge(5 грешни отговора). Аз ли не разбирам условието или нещо по кода е сгрешено:
CREATE PROCEDURE usp_GetHoldersWithBalanceHigherThan(@balanceThreshold DECIMAL(19,4))
AS
BEGIN
WITH TotalBalanceOnAllAccounts_CTE(Id, TotalBalance) AS
(
SELECT a.AccountHolderId, SUM(a.Balance)
FROM Accounts AS a
GROUP BY a.AccountHolderId
)
SELECT ah.FirstName AS [First Name], ah.LastName AS [Last Name]
FROM AccountHolders AS ah
INNER JOIN TotalBalanceOnAllAccounts_CTE AS tboaa
ON ah.Id = tboaa.Id
WHERE tboaa.TotalBalance > @balanceThreshold;
END