27,579
社区成员
发帖
与我相关
我的任务
分享
-- 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;