STORED PROCEDURE

  • RandomStream - Monday, January 8, 2018 4:52 PM

    doug.brown - Monday, January 8, 2018 4:12 PM

    RandomStream - Monday, January 8, 2018 10:21 AM


    3. if(@years_old = 4 and @Gl >= 15) and  if(@years_old = 3 and @Gl >= 14) can be replaced with one condition if(@years_old >= 3 and @Gl >= 14)

    These are not logically equivalent.  The OP's first condition will only return records when @years_old = 4 if @GL is 15 or greater.  Your combined version will return @years_old = 4 when @GL = 14.

    You're correct, Doug. My bad.

    Replacing it with one condition:

    IF (@years_old = 4 and @Gl >= 15) OR (@years_old = 3 and @Gl >= 14)

Viewing post 16 (of 15 total)

You must be logged in to reply to this topic. Login to reply