Re: Lowest non-zero number

2010-12-03 Thread Shawn Green (MySQL)
On 12/3/2010 12:16, Mark Goodge wrote: On 03/12/2010 16:56, Paul Halliday wrote: On Fri, Dec 3, 2010 at 12:50 PM, 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? SELECT number FROM table WHERE number>

Re: Lowest non-zero number

2010-12-03 Thread Mark Goodge
On 03/12/2010 16:56, Paul Halliday wrote: On Fri, Dec 3, 2010 at 12:50 PM, 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? SELECT number FROM table WHERE number> 0 ORDER BY number ASC LIMIT 1; Sorry

Re: Lowest non-zero number

2010-12-03 Thread Shawn Green (MySQL)
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

Re: Lowest non-zero number

2010-12-03 Thread Paul Halliday
On Fri, Dec 3, 2010 at 12:50 PM, 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? > SELECT number FROM table WHERE number > 0 ORDER BY number ASC LIMIT 1; ? -- Paul Halliday Ideation | Indiv

Lowest non-zero number

2010-12-03 Thread Mark Goodge
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 -- http://mark.goodge.