in reply to LIMIT clause in Class::DBI
For more complex queries you need to fall back on the underlying Ima::DBI query mechanism.There is an example given of a query, using the MySQL 'LIMIT' function:
Music::Artist->set_sql(most_cds => qq{ SELECT artist.id, COUNT(cd.id) AS cds FROM artist, cd WHERE artist.id = cd.artist GROUP BY artist.id ORDER BY cds DESC LIMIT 10 }); my @artists = Music::Artist->search_most_cds();
|
|---|