Say schema is
EntryDate
,Dim1
,Dim2
,Dim3
And I want to create a view
EntryDate
,Dim1
,Dim2
,Dim3
,IsNew
Where IsNew is true if that tuple of Dim1,Dim2,Dim3 hadn't existed for earlier EntryDate.
Not concerned about performance as I will eventually regenerate the base table. But I want to test some business logic beforehand using a view.
1条答案
按热度按时间k3fezbri1#
One method would be to use a
ROW_NUMBER
; if the value is1
it's the first row and is new, if not it isn't new.