Reputation: 4094
I have a table with one of the columns : cost
, it is of decimal type with 2 d.p.
Now I would like to select all rows from this table where cost
's decimal part is not 0
For example, I do not select the row if cost
is 150.00 or 222.00, but would like to select if cost
is 0.20 or 123.12, etc.
How can this be done in a single select query?
Upvotes: 3
Views: 322
Reputation: 453707
For rows where there is a zero decimal part Floor(cost)
will equal cost
and it won't where there is a non zero decimal part.
SELECT *
FROM YourTable
WHERE Floor(cost) <> cost;
Upvotes: 5