Have you ever faced a problem while using SQL Query in your software where you have to replace the blank or null field in database table with “0” or “1” but you are unable to use “If condition” in the sql?

Here I have got a solution where you can replace or fill the blank or null table data with “0” or “1” by using COALESCE in SQL query.

Let us assume we have a table called “ITEM” and it has four fields named “ order_no”, “item_no”, “qty” and “style_sample_no” . In the field “style_sample_no” there is no data i.e. this filed is blank/null or empty.

Flickr Photos

My Favorite Lines

Synopsis of Bhagavad Geeta!!!
What has happened, happened fair,
What is happening, happening fair!
What will be will be fair!
What have you lost that you are crying for?
What did u have with you during your birth that u have lost?
What have u created that is destroyed??
What u have taken, taken from here!
What u have given, given here!
What u possess today,
That was possessed by other yesterday…
And will be possessed by some other tomorrow!!!
‘Change’ is the very law of the world!!!