# \[PHP\] SQL select max(value) & min(value)

**URL:** <https://forum.kirupa.com/t/php-sql-select-max-value-min-value/147069>\
**Category:** Uncategorized\
**Created:** [May 6, 2005, 6:21pm UTC](https://forum.kirupa.com/t/php-sql-select-max-value-min-value/147069 "2005-05-06T18:21:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thinker2501](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@Thinker2501](https://forum.kirupa.com/u/Thinker2501)\
**Post date:** [May 6, 2005, 6:21pm UTC](https://forum.kirupa.com/t/php-sql-select-max-value-min-value/147069/1 "2005-05-06T18:21:39Z")

</div>

I have a database of real estate listings in office buildings. There are multiple suites per building. I want to do a query that returns the largest suite and smallest suite per address so this is what i have and i keep getting empty results:

SELECT max(size) FROM listing GROUP By ‘street\_number’ ORDER by ‘$sort’

if I replace max with \* then it works fine, so I know the rest of the query is structured correctly. The column I want the max and min Values from is ‘size’. Any help will be appriciated.
