# Sql question

**URL:** <https://www.ruby-forum.com/t/sql-question/155056>\
**Category:** Rails\
**Created:** [December 7, 2008, 3:33am UTC](https://www.ruby-forum.com/t/sql-question/155056 "2008-12-07T03:33:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nn2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/90ced4/32.png) [@nn2001](https://www.ruby-forum.com/u/nn2001)\
**Post date:** [December 7, 2008, 3:33am UTC](https://www.ruby-forum.com/t/sql-question/155056/1 "2008-12-07T03:33:11Z")

</div>

I have two models of matches and teams that are in habtm relations.  
now now to render all the teams with the number of other teams that they  
have match with? Also I tried to run find\_by\_sql but don’t know how to  
add :include with it. Any help?
