Select first occurrence of a value per group with condition based on the most recent record of group
I currently have a credit risk default table where default status of parties are stored. I have a business requirement to get the earliest date where default has occurred and where the most recent record has not changed status to Non-Default. I have provided some sample data to illustrate the scenario.
STRING_SPLIT and ROW_NUMBER() – maintaining order
I have a requirement to split a string based on a delimiter and to pull the values based on their ordinals. As I am on SQL Server 2019, I cannot use String_Split with ordinal enabled. Trying to replicate the same functionality using below STRING_SPLIT and Row_Number() query.