27,582
社区成员




-- UserId 是主键,只可能取一条记录出来,不需要那么多限制,越简单越好。
SELECT [UserId],
[UserBalance],
[TotalAmount],
[MissionAmount],
[ToCardAmount],
[UserGoldCoinBalance],
[TotalGoldCoinAmount],
[CreditScore],
[CreatedAt],
[CreatedUserId],
[UpdatedAt],
[UpdatedUserId]
FROM [UserAccount] WITH(NOLOCK)
WHERE [UserId] = @UserId
SELECT TOP(1) [UserId],
[UserBalance],
[TotalAmount],
[MissionAmount],
[ToCardAmount],
[UserGoldCoinBalance],
[TotalGoldCoinAmount],
[CreditScore],
[CreatedAt],
[CreatedUserId],
[UpdatedAt],
[UpdatedUserId],
NEWID() AS RowIndex
FROM [UserAccount] WITH(NOLOCK)
WHERE ([UserId] = @UserId0)
ORDER BY RowIndex;