# Using joins to quickly cross compare tables?

**URL:** https://forum.kirupa.com/t/using-joins-to-quickly-cross-compare-tables/267629
**Category:** programming
**Created:** [August 4, 2008, 7:29am UTC](https://forum.kirupa.com/t/using-joins-to-quickly-cross-compare-tables/267629 "2008-08-04T07:29:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DesignerMichael](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@DesignerMichael](https://forum.kirupa.com/u/DesignerMichael)
#### Post date: [August 4, 2008, 7:29am UTC](https://forum.kirupa.com/t/using-joins-to-quickly-cross-compare-tables/267629/1 "2008-08-04T07:29:46Z")

</div>

I’m wonder if joins would help me do this fast

I have one table of id’s, and I want to count how many of those id’s match id’s in the second table.

Something like this perhaps?  
SELECT COUNT(t1.uid) FROM users AS t1 INNER JOIN uid AS t2 ON t1.uid = t2.uid;
