trouble deleting from a table

  • I need to delete rows from a table where col1 is within a range of values and col2 of the same row is within a certain range of values. how is this possible?

  • DELETE FROM MyTable

    WHERE col1 BETWEEN @a AND @b-2

    AND col2 BETWEEN @C AND @d

    Read about BETWEEN in Books Online before you use this so that you understand how it deals with values that are exactly equal to the upper and lower limits.

    John

  • thank you very much! this done the trick!

Viewing 3 posts - 1 through 2 (of 2 total)

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