October 18, 2021 at 1:28 am
Hello, I am looking for output where
EG_RequestID = 175998968 and Reissue from paymentID = 333333 from above both temp table.
I will get multiple reissue payment ID,
Can you please help me to write query ?
October 18, 2021 at 12:34 pm
But, from what I can see, the Payment_ID column matches to a value 67280309 for Reissued_from_payment_id. How do you related it to 33333 when the payment_id for that is 22222? I think you need to explain some more what it is that you expect to get from the data you have provided. Based just on the information in front of us, I don't see a solution that will be consistent from query to query.
Are you trying to find the previous reissued_from_payment_id in the ##second table? If so, can we guarantee the ordering of that column will always be what it is in the example (and yes, before anyone tells me, assuming I put an ORDER BY statement in, of course)? If that's what you're looking for, maybe there's a solution, but you need to explain in more detail.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
October 19, 2021 at 3:48 am
Thank you. Yes, I used created date order by and it works using function last_value.
Thanks
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy