I can get a count of records based on some criteria such as length of the data in specific columns. But it seems I can get first X records (say 20 records) and they could all be the same length.
How do I get 20 records of each length?
SELECT LABEL_ID, DEST, WEIGHT_OZ
FROM MYTABLE
WHERE
LENGTH(LABEL_ID) IN (10,13,24)
AND ROWNUM <= 20;
This returns 20 records of labels of length 10 (since there are more than 20 records of that length). How do I get 20 of length 10, 20 of length 13, 20 of length 24, etc.?
Thanks.