List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:February 2 2000 6:04pm
Subject:Re: order by price, but it's a varchar
View as plain text  
At 10:00 AM -0500 02-02-2000, Mr. Anthony R.J. Ball wrote:
>   We have a product database, which has a two part product name. The first
>part groups products that are the same type, the second part designates it's
>attributes (small,red, various things). in our category pages we select
>with a group by on the first part of the product name, IE
>SELECT product,price FROM products GROUP BY product
>
>what we want is to get the product with the lowest price, however this doesn't
>seem to work right, since the price is a varchar. How can this be done
>(short of changing price to be a float field).


Is there some reason not to change it to be a float?  You'll get much
better performance.

-- 
Paul DuBois, paul@stripped
Thread
order by price, but it's a varcharMr. Anthony R.J. Ball2 Feb
  • Re: order by price, but it's a varcharDan Nelson2 Feb
    • Re: order by price, but it's a varcharMr. Anthony R.J. Ball2 Feb
  • Re: order by price, but it's a varcharsasha2 Feb
    • Re: order by price, but it's a varcharMr. Anthony R.J. Ball2 Feb
  • Re: order by price, but it's a varcharPaul DuBois2 Feb