0

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 ?

5
Contributors
4
Replies
26
Views
1 Year
Discussion Span
Last Post by AndrisP
0

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?

0

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.

0

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.