Monday, February 20, 2012

lowest price > 0

Hello,
How can I select the lowest price excluding 0?
in this example '4'
part price
001 0
001 4
001 5
thx, shSELECT MIN(price) FROM [YourTable] WHERE
PRICE > 0
-Jason
"Steve H" <steve9@.gmail.com> wrote in message
news:OsEfMuJMFHA.3844@.TK2MSFTNGP14.phx.gbl...
> Hello,
> How can I select the lowest price excluding 0?
> in this example '4'
> part price
> 001 0
> 001 4
> 001 5
> thx, sh
>|||nevermind, coffee hadn't quite settled into the brain this morning...
"Steve H" <steve9@.gmail.com> wrote in message
news:OsEfMuJMFHA.3844@.TK2MSFTNGP14.phx.gbl...
> Hello,
> How can I select the lowest price excluding 0?
> in this example '4'
> part price
> 001 0
> 001 4
> 001 5
> thx, sh
>|||select min(t.price)
from
(select price
from mytable
where price > 0) t
"Steve H" <steve9@.gmail.com> wrote in message
news:OsEfMuJMFHA.3844@.TK2MSFTNGP14.phx.gbl...
> Hello,
> How can I select the lowest price excluding 0?
> in this example '4'
> part price
> 001 0
> 001 4
> 001 5
> thx, sh
>

No comments:

Post a Comment