Skip to content
Advertisement

Tag: greatest-n-per-group

Select the Max row number for an account

I need to only pull the max row number for an account. I know it’s a grouping issue. Current data: ACCOUNT_UID ID NAME ACADEMIC_PERIOD CAT_BY_DATE CAT_DATE MAX_ROW abc abc Popeye 202190 CPT 9/15/2021 1 abc abc Popeye 202190 CSH 10/4/2021 2 I only need the second row. Current query: Answer You can try the following: The idea is to apply

Filter data based on group SQL Netezza

Please I have the below table, I need to filter the data based on the DATE column, In the Sus_ID level if the DATE column has NULL get this row or if the hasn’t NULL record will get the row for the newest DATE the desired result should be the below I tried the below code but it didn’t work

How to show the most recent value for each row [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question This is my current query. I used an inline view to only show the top 5 results for the companies with the highest volume of

Advertisement