# MYSQL - Most common answer

**URL:** <https://forum.kirupa.com/t/mysql-most-common-answer/238007>\
**Category:** programming\
**Created:** [September 6, 2007, 9:18am UTC](https://forum.kirupa.com/t/mysql-most-common-answer/238007 "2007-09-06T09:18:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neolumi](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/neolumi/32/1306_2.png) [@Neolumi](https://forum.kirupa.com/u/Neolumi)\
**Post date:** [September 6, 2007, 9:18am UTC](https://forum.kirupa.com/t/mysql-most-common-answer/238007/1 "2007-09-06T09:18:18Z")

</div>

Hey people, yet another mysql question.

# responses

id  
question  
answer

# questions

id  
title

# answers

id  
value

what I need to do is get the most common answer, so far I’ve got this:

```php
SELECT a.ques_id, a.ques_title, ????(b.respa_answer) AS common_answer, c.qua_value
FROM inter_questions AS a
LEFT JOIN inter_respondant_answers AS b ON b.respa_question = a.ques_id
RIGHT JOIN inter_question_answers AS c ON b.respa_answer = c.qua_parent
GROUP BY a.ques_title
ORDER BY a.ques_id

```

Is this going to take variables? 😕

Edit: BTW the number of possible answers is variable
