79573894

Date: 2025-04-14 19:42:47
Score: 5
Natty:
Report link

I was able to find a post from 7 years ago that give me some direction and came up with this. Thanks for looking.. Brent

  ---solution  
SELECT  acct_id,sa_type_cd, end_dt
FROM
(SELECT acct_id,sa_type_cd,end_dt,
               rank() over (partition by acct_id order by end_dt desc) rnk
          FROM test
          WHERE sa_type_cd IN ( 'E-RES', 'E-GS' ) and end_dt is not null)
WHERE rnk = 1 and acct_id = '299715';
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (3): give me some
  • Contains signature (1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Brent