I have a DB that has a numeric field and I need to search all the rows and return only the non whole numbers.
I have tried the query below and it keeps retuning records that have 0.
SELECT
li.QTY
FROM
TABLE LI
WHERE
li.QTY like '%.%'
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use LIKE only with char fields, not with number (integer or float) ones.
If by “whole numbers” you mean 0.0 , 2.0 , -5.0 , etc. and not 12.5 , 0.67 then this can do:
(for SQL-Server: edited the TRUNC into ROUND)
You could also use the FLOOR or CEILING functions: