I need to accomplish a select of records with a max rowcount. Let me try to explain.
I have over 2 million records that would of hit different strategy types and strategy ids. I want to simply select a population of 5 records(call them refno's) for every strategy type for every strategy ID.
I can't seem to get around this one.
example...
5 refno's for strategy id 80 for strategy type charles
5 refno's for strategy id 81 for strategy type charles
5 refno's for strategy id 97 for strategy type charles
5 refno's for strategy id 80 for strategy type john
5 refno's for strategy id 89 for strategy type john
etc...
SELECT refno, strategy type, strategy id
FROM strategy_table (all this data is in 1 table)
WHERE ?
GROUP BY strategy type, strategy id
I just can't wrap around this one.
set rowcount 5 command would do it, but I have a double condition. I need the rowcount 5 but for every strategy type and every strategy id.
I've been searching resources and on the web for 2 days and can't find anything on this....
Any help would be awesome.
Thanks
I have over 2 million records that would of hit different strategy types and strategy ids. I want to simply select a population of 5 records(call them refno's) for every strategy type for every strategy ID.
I can't seem to get around this one.
example...
5 refno's for strategy id 80 for strategy type charles
5 refno's for strategy id 81 for strategy type charles
5 refno's for strategy id 97 for strategy type charles
5 refno's for strategy id 80 for strategy type john
5 refno's for strategy id 89 for strategy type john
etc...
SELECT refno, strategy type, strategy id
FROM strategy_table (all this data is in 1 table)
WHERE ?
GROUP BY strategy type, strategy id
I just can't wrap around this one.
set rowcount 5 command would do it, but I have a double condition. I need the rowcount 5 but for every strategy type and every strategy id.
I've been searching resources and on the web for 2 days and can't find anything on this....
Any help would be awesome.
Thanks