Knocks/BackEnd/Knoks.Operate/Stored Procedures/TRN_GetLatestAccountTransac...

24 lines
615 B
Transact-SQL

CREATE PROCEDURE [dbo].[TRN_GetLatestAccountTransaction]
@AcountTransactionTypeId SMALLINT
AS
SELECT TOP (1) [AccountTransactionId]
,[AccountId]
,[UserId]
,[AccountTransactionDate]
,[AccountTransactionTypeId]
,[Symbol]
,[Amount]
,[AmountUSD]
,[ExternalReferenceId]
,[Comment]
,[Origin]
,[CurrentBalance]
,[CurrentBonusBalance]
,[OperatorId]
,[WalletAddress]
,[PendingId]
,[KnokId]
FROM [AccountTransactions]
WHERE [AccountTransactionTypeId] = @AcountTransactionTypeId
ORDER BY [AccountTransactionDate] DESC