I have a stored procedure that is returning me some records. Now I want to change the condition on which the records are being shown on the basis of a condition
select * from table
WHERE cond1 = c1
AND cond2 = c2
basically I want a structure like this
if(Val1= Val2) then
select * from table
WHERE cond1 = c1
AND cond2 = c2
AND cond3 = c3
else
select * from table
WHERE cond1 = c1
AND cond2 = c2
Since the stored proc is huge and I can't change too much in that so I can only change the where condition using if statement.