I have a scenario where I want to pull up to the first 500 rows for each agent_ID on a table. Example:
TABLE NAME: AGENT
Schema: AGENT_ID, CUST_ID, CUST_F_NAME, CUST_L_NAME
PK: CUST_ID
Scenario:
AGENT_ID 1234 has 800 results AGENT_ID 4567 has 1000 results AGENT_ID 1212 has 300 results
I would like my results to pull only up to 500 records for each AGENT_ID. This table has hundreds of distinct AGENT_ID's.
I am having issues trying to write a SQL that will pull down this data and would like some help or suggestions.