In my querry i am using a variable for B and S( they r the columns of a table) In case the value for field S in provided as NULL then i want all the rows with given value of column 'B'and if field 'S' is passed some non-null value then i want the rows having given values for B and SFor example B S1 121 1312 142 now i want to write a querry such that if i pass 1 for B and 12 for S then my querry returns row 1 only and if i pass 1 for B and NULL for S then i get row 1,2 and 3. Hopei make my self clearer now