tags:

views:

13

answers:

1

Hi everyone, I wanna make a query that fetches only the rows that has 'cost' value grader than zero.The cost column has double data type.When i write a query like that,

select cost from xxx where cost>0;

it retrieves the rows only that has value grader than or equal to one.For example it doesnt take like 0.02 or 0.3 values.The query sees these type values as zero.How can i achieve my goal? Thanks for advance...

+1  A: 

I can't replicate your problem using mysql 5.41.

Show us the result of describe table xxx;

What happens if you issue the query:

select cost from xxx where cost > 0.0;

Is your query actually:

 select ceil(cost) from xxx where cost > 0.0;

If so, for values of cost > 0 but <= 1, you'd get a result set of 1.

tpdi
Thanks for your help it works!
cubuzoa