I guess this would be more along the lines of an SQLish question. I have an SQL query that looks something like: (changed for obvious reasons)
select sum(t.amount) as total, a.id, t.id from accounts a, transactions t where a.id = t.id and rownum < ? group by (a.id, t.id)
So I have this query getting converted to CDBI objects via sth_to_objects. I would like to be able to limit the amount of rows I get back to a certain number, but to no avail the group by messes rownum up, becuase the join will get rownum records and group by compacts them, so I essentially can get less than what my rownum states.
Is there a way I can limit the number of objects I get back using Class::DBI, am I going to have to get the whole object array back and truncate it, or is there any other way via SQL to get my desired result without the addition of a second query?
In reply to (Class::DBI Oracle SQL) rownum and group by woes by Tyraziel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |