Grouping data into buckets
Does anyone know how to easily query data in a table into 4 equally sized groups? I have a table with roughly 10K rows and I need to query the data in such a way that each group would have 2500 rows.
Thanks in advance.
Try "group by mod(rownum,4)"
Last edited by DaPi; 01-06-2004 at 09:10 AM.
ORA-00979: not a GROUP BY expression
how can i do without grouping?
How do I group without grouping ? ?
SQL> select mod(rownum,4), count(*)
2 from all_objects
3 group by mod(rownum,4)
i don't want the count(*).... group by mod(rownum,4)
i want the * .... group by mod(rownum,4)
i mean i want the full row.
Sorry rajabalachandra, I have no idea what you are trying to do . . . .
Perhaps you could restate your problem with an example of a table to be processed and the result you want?
Click Here to Expand Forum to Full Width