Skip to main content
added 26 characters in body
Source Link
Barmar
  • 788.4k
  • 57
  • 554
  • 668

You need to parenthesize your WHERE expression correctly:

WHERE (pp.project_leader =Project_Leader= ps_Project_Leader
        OR Project_Leaderps_Project_Leader is null)
and (pp.rd_plan =RD_Plan= ps_RD_Plan
        OR RD_Planps_RD_Plan is null)
and (pp.approval_status = Approval_Statusps_Approval_Status
        OR Approval_Statusps_Approval_Status is null)
and (pp.design_plan = Design_Planps_Design_Plan
        OR Design_Planps_Design_Plan is null)
and PP.actual_completion is null;

because AND has higher precedence than OR.

You need to parenthesize your WHERE expression correctly:

WHERE (pp.project_leader =Project_Leader
        OR Project_Leader is null)
and (pp.rd_plan =RD_Plan
        OR RD_Plan is null)
and (pp.approval_status = Approval_Status
        OR Approval_Status is null)
and (pp.design_plan = Design_Plan
        OR Design_Plan is null)
and PP.actual_completion is null;

because AND has higher precedence than OR.

You need to parenthesize your WHERE expression correctly:

WHERE (pp.project_leader = ps_Project_Leader
        OR ps_Project_Leader is null)
and (pp.rd_plan = ps_RD_Plan
        OR ps_RD_Plan is null)
and (pp.approval_status = ps_Approval_Status
        OR ps_Approval_Status is null)
and (pp.design_plan = ps_Design_Plan
        OR ps_Design_Plan is null)
and PP.actual_completion is null;

because AND has higher precedence than OR.

Source Link
Barmar
  • 788.4k
  • 57
  • 554
  • 668

You need to parenthesize your WHERE expression correctly:

WHERE (pp.project_leader =Project_Leader
        OR Project_Leader is null)
and (pp.rd_plan =RD_Plan
        OR RD_Plan is null)
and (pp.approval_status = Approval_Status
        OR Approval_Status is null)
and (pp.design_plan = Design_Plan
        OR Design_Plan is null)
and PP.actual_completion is null;

because AND has higher precedence than OR.