I am trying to convert this TSQL:
This doesn’t really seem relevant all that relevant at this point. Given some input data either the query produces the expected result or it doesn’t.
What am i doing wrong? Please assist?
You need to provide more info - specifically the input data mentioned above. Try making a reproducer on this fiddle site.
David J.