RoR-Sql query

Well, I don’t know the answer, but you can probably use the sql query mentioned in this page: http://www.keithjbrown.co.uk/vworks/mysql/mysql_p5.php ( Do a browser search on string “Joining Three Tables”)

BTW, this email is to mention a different problem in your query: should not card be cards and book be books in your query (table names are, by convention, plural in rails) Try that too, might work.

Thanks,
Abhinav