# Select column with largest number in a specific row

**URL:** <https://forum.kirupa.com/t/select-column-with-largest-number-in-a-specific-row/280497>\
**Category:** Uncategorized\
**Created:** [January 28, 2009, 10:22am UTC](https://forum.kirupa.com/t/select-column-with-largest-number-in-a-specific-row/280497 "2009-01-28T10:22:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mak\_Valley](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Mak\_Valley](https://forum.kirupa.com/u/Mak_Valley)\
**Post date:** [January 28, 2009, 10:22am UTC](https://forum.kirupa.com/t/select-column-with-largest-number-in-a-specific-row/280497/1 "2009-01-28T10:22:32Z")

</div>

how do i do it? lets say i’m making a poll and this is what i have:

// table structure  
// name, question, numans, ans1, ans2, ans3, ans4, ans5, res1, res2, res3, res4, res5

ans1-5 are possible selections (string);  
res1-5 are number of votes (int);  
now, say i already have a row pre-selected and i want to select one of ans1-5 based on the highest numerical value from res1-5… for instance: res2 has 5 votes, the greatest out of any of the others. what i need to do is select only ans2.  
possibilities?
