List:General Discussion« Previous MessageNext Message »
From:Shawn Green (MySQL) Date:December 3 2010 5:04pm
Subject:Re: Lowest non-zero number
View as plain text  
On 12/3/2010 11:50, Mark Goodge wrote:
> Given a table containing a range of INT values, is there any easy way to
> select from it the lowest non-zero number?
>
> Obviously, MAX(column) will return the highest, but MIN(column) will
> return 0 if any row contains a 0, which isn't what I want.
>
> Any clues?
>
> Mark

SELECT MIN(column) FROM table WHERE column>0 ?

-- 
Shawn Green
MySQL Principal Technical Support Engineer
Oracle USA, Inc.
Office: Blountville, TN
Thread
Lowest non-zero numberMark Goodge3 Dec
  • Re: Lowest non-zero numberPaul Halliday3 Dec
    • Re: Lowest non-zero numberMark Goodge3 Dec
      • Re: Lowest non-zero numberMySQL)3 Dec
  • Re: Lowest non-zero numberMySQL)3 Dec