Reputation: 1828
I have a table Balance
with a column Coins
of double type in my MySql database. However, in fact, I store int values there. So, I want to change the type from double to int. But before, I want to be 100% sure that there are no floating-point numbers in this column.
What kind of SQL request should I write to achieve this?
Upvotes: 0
Views: 38
Reputation: 1269563
You can use:
select coins
from balance
where coins <> floor(coins);
Upvotes: 2