(SELECT
(SELECT ROW_NUMBER() OVER (order by t.NotificationID)) as RowNumber,
[NotificationID],[ProjectID],[TeamMemberID],[OperationType],
[Hours],[Occurance],[Period],[NotificationText],
[NotificationRecipientIDs],[NotificationRecipientClienitsIDs]
FROM tblIA_Notifications t
WHERE IsDeleted = 0 AND IsActive = 1
)
上面的查询总是为每一行返回第 1 行。当我在外面使用 select 语句时,它的问题。否则,如果我删除外部选择语句就可以了。
我不明白这种行为。