Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2004
    Location
    Singapore
    Posts
    89

    Question Unanswered: between operator

    I have read in many documents that using

    .....
    WHERE column >= value1 AND column <= value2;

    is better than using

    .....
    WHERE column between value1 AND value2;


    How does that make difference?
    Thanks and Regards,

    Praveen Pulikunnu

  2. #2
    Join Date
    Apr 2003
    Location
    NY
    Posts
    208

    Re: between operator

    Do an explain plan / trace on both versions of your code.

    I don't see a difference between the two as it looks that both use an implicit Select Into query.

  3. #3
    Join Date
    Jan 2004
    Location
    India
    Posts
    191
    Yes corloa is correct

    Thanks,
    Pagnint
    (No need to search web before posting new question)

  4. #4
    Join Date
    Jan 2004
    Location
    Singapore
    Posts
    89
    Originally posted by paginit
    Yes corloa is correct

    Thanks,
    Thanks all for ur comments

    I had checked the query thru explain plan and I had found both are the same. But i had read in many documents to do that kind of conversion. I dont know what difference will that make in a query.
    Thanks and Regards,

    Praveen Pulikunnu

  5. #5
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    In what documents did you read this myth? Just so we know what documents to avoid!

  6. #6
    Join Date
    Oct 2003
    Posts
    87
    WHERE column >= value1 AND column <= value2;

    Provides better readability . . . removes the question, does BETWEEN include or exclude the beginning and ending range values.
    Oracle - DB2 - MS Access -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •