3

I am working with a table having amount field of type DECIMAL(5,2). The values in the column are

id  amount
1   9.00
2   1.83
3   7.01
4   8.00
5   99.85

I have to get the columns with only that have nonzero after decimal.

From the above list i should get

id  amount
2   1.83
3   7.01
5   99.85

How should i write the query to get the result?

I am using MySql 5.6.

livestrong
  • 65
  • 6
  • after some searching through SO i found another post http://stackoverflow.com/questions/15240652/fetch-records-that-are-non-zero-after-the-decimal-point-in-postgresql even though its for postgres, I think the same can be applied here too – livestrong Jul 06 '15 at 04:50

1 Answers1

1

Just a guess:

SELECT * 
from tblname 
where amount=FLOOR(amount)
Drew
  • 24,851
  • 10
  • 43
  • 78