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.
Steve
Printable View
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.
Steve
Try "group by mod(rownum,4)"
ORA-00979: not a GROUP BY expression
how can i do without grouping?
Ugh?
How do I group without grouping ? ? :confused:Code:SQL> select mod(rownum,4), count(*)
2 from all_objects
3 group by mod(rownum,4)
4 /
MOD(ROWNUM,4) COUNT(*)
------------- ----------
0 2134
1 2135
2 2135
3 2135
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?
WHY U WANNA DO THIS?