Jump to content

Data not returning the correct smallest amount !!


Skylight_lady

Recommended Posts

I have a table with a price and ID. My totals are shown in the table below with the price ID:

ID               Price
504            4720.00
504            864.00
504            16571.84

 

Now, i am trying to write a mysql ststement that allows me to get the lowest price in the database from the table above e.g 864.00

SELECT MIN(price) AS TOTALLEAST FROM mytable WHERE ID = '504' LIMIT 1

 

The above sql statement is only give me the 16571.84 result. Why exactly is this? And whats the correct statement?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.