Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要从数据集中删除小数点后有数字的观察值。一些数字混入了不应该出现的日期集中,除了小数点后有一个数字外,我们没有什么可以告诉它们的,例如:9.42
与实际数据相比,只有 9.0、10.0、100.0。
有没有办法在 SQL 中做到这一点?
像这样的东西适用于大多数数据库:
delete from table where number <> cast(number as int);
或者,如果 "number" 真的是一个字符串:
delete from table where number like '%.%' and number not like '%.0';