Problem and its Solution in SQL Query: How to solve If database table field is blank or null then replace or fill it with zero (0) or one (1) without using if condition in query||Solution procedure of if field = blank or Null then field =0 or 1


sql query

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.

  Read more of this post

%d bloggers like this: