# Comparing MySQL tables

**URL:** <https://forum.kirupa.com/t/comparing-mysql-tables/186591>\
**Category:** programming\
**Created:** [April 22, 2006, 5:09pm UTC](https://forum.kirupa.com/t/comparing-mysql-tables/186591 "2006-04-22T17:09:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimjiminyjimjim](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jimjiminyjimjim](https://forum.kirupa.com/u/jimjiminyjimjim)\
**Post date:** [April 22, 2006, 5:09pm UTC](https://forum.kirupa.com/t/comparing-mysql-tables/186591/1 "2006-04-22T17:09:43Z")

</div>

I have two MySQL tables which I need to compare and then order.

One group of people choose their 5 favourite things which go into table A. Another group choose their 5 favourite things from a list of all the answers given in table A. The results of which go into table B.

So table A and B will have all the same values just with different frequencies.

What I want to be able to do is rank Table A depending on how popular each of the values in table B are.

i.e If person1 chose their favourite 5 things (stored in table A) as cat, dog, sheep, pig, cow and the most popular choices in table B were cat, dog, sheep, pig, cow then person1 would be at the top. If person1 chose all the unpopular values in table B then they would be at the bottom.

I hope this makes sense!!! Any help would be greatly appreciated. Thank you.

---

<div class="post-metadata">

**Author:** ![chrisclick](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/chrisclick/32/1991_2.png) [@chrisclick](https://forum.kirupa.com/u/chrisclick)\
**Post date:** [April 22, 2006, 5:31pm UTC](https://forum.kirupa.com/t/comparing-mysql-tables/186591/2 "2006-04-22T17:31:39Z")

</div>

Please do not double post
