Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Problem with table joins with Class::DBI

by Roy Johnson (Monsignor)
on Dec 24, 2003 at 16:19 UTC ( #316880=note: print w/replies, xml ) Need Help??

in reply to Problem with table joins with Class::DBI

According to perldoc Class::DBI:
Of course, any query can be added via set_sql, including joins. So, to add a query that returns the 10 Artists with the most CDs, you could write (with MySQL):
Music::Artist->set_sql(most_cds => qq{ SELECT, COUNT( AS cds FROM artist, cd WHERE = cd.artist GROUP BY ORDER BY cds DESC LIMIT 10 }); my @artists = Music::Artist->search_most_cds();

The PerlMonk tr/// Advocate

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://316880]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2016-10-22 21:05 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (298 votes). Check out past polls.