Hi there,
Is there anyway to do a GROUP BY statement with LIMIT in such a way that LIMIT acts on the Groups found as opposed to the hits found?
In other words, here's my select option statement:
$db->select_options("Group by Add_Date Order by Add_Date asc Limit 5,3");
$sth = $db->select ({Username =>$user}
Now the problem is that the results from such a query are based on the first 5 rows of data that match the query, and what I need is to be able to bring up all the results for the first 5 groups found.
i.e..
group 2003-11-01 might have 5 hits and
group 2003-11-02 might have 15 hits.
etc... thru group5
I have already tried manually limiting the number of groups that I want by excluding the Limit cause, but as that returns all the records (several thousand), it takes longer each time (with new data constantly being added) to scroll through each row and either dump it or keep it depending on whether i'm looking for the equivalent of nh=1, 2, 3, 4, 5 etc....
How else could a query be constructed to do this?
thanks for you help.
peace.
Kyle
Is there anyway to do a GROUP BY statement with LIMIT in such a way that LIMIT acts on the Groups found as opposed to the hits found?
In other words, here's my select option statement:
$db->select_options("Group by Add_Date Order by Add_Date asc Limit 5,3");
$sth = $db->select ({Username =>$user}
Now the problem is that the results from such a query are based on the first 5 rows of data that match the query, and what I need is to be able to bring up all the results for the first 5 groups found.
i.e..
group 2003-11-01 might have 5 hits and
group 2003-11-02 might have 15 hits.
etc... thru group5
I have already tried manually limiting the number of groups that I want by excluding the Limit cause, but as that returns all the records (several thousand), it takes longer each time (with new data constantly being added) to scroll through each row and either dump it or keep it depending on whether i'm looking for the equivalent of nh=1, 2, 3, 4, 5 etc....
How else could a query be constructed to do this?
thanks for you help.
peace.
Kyle