Hey ! I'm looking for sql 'like' command help....
I had mysql database and it had settlement table. On that table there is column named 'settlement'.
In the settlement column there are so many amounts.....
Now I want to find recors '0 values'
Can anybody help me ?

1 Year
Discussion Span
Last Post by AndrisP

The column is a string type and the value is literally something like 0 values or is an integer, float column?

Can you show the table schema and an example of data?


I have found it is a good idea to cover the records where the field is blank, 0 or null with something like:

SELECT * FROM settlement WHERE settlement < 0.01 or settlement IS NULL

I realize this will get records where the settlement is not zero but sometimes you need to know about these. I inherited a database that had values like 0.00033 stored for the balance and I queried for value = 0 and was missing records.


I think NULLIF(settlement, 0) IS NULL is better than settlement < 0.01 or settlement IS NULL
Try this:

SELECT * FROM settlement WHERE NULLIF(settlement, 0) IS NULL
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.