# Help with SQL statement: comparing multiple columns

**URL:** https://forum.kirupa.com/t/help-with-sql-statement-comparing-multiple-columns/123316
**Category:** Uncategorized
**Created:** [September 22, 2004, 3:07pm UTC](https://forum.kirupa.com/t/help-with-sql-statement-comparing-multiple-columns/123316 "2004-09-22T15:07:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Flashmatazz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/flashmatazz/32/140_2.png) [@Flashmatazz](https://forum.kirupa.com/u/Flashmatazz)
#### Post date: [September 22, 2004, 3:07pm UTC](https://forum.kirupa.com/t/help-with-sql-statement-comparing-multiple-columns/123316/1 "2004-09-22T15:07:01Z")

</div>

Does somebody know if it’s possible with a single SQL statement to compare the values of multiple columns in one row of an MySQL database?

I want to select the lowest value from these columns.

I could do this with a loop within my PHP script, but this would mean that I need to do multiple database queries and each time compare the selected value with the previously selected value. However, preferrably I just want to do 1 query.

Cheers.
