Results 1 to 4 of 4

Thread: Oracle Query

  1. #1
    Join Date
    Nov 2003
    Location
    Bangalore, India
    Posts
    3

    Unanswered: Oracle Query

    Is there a performace difference in using between operator and <= and >=. For example, if there is a comparison between 2000 and 5000 which is better:

    select * from <table> where <col> between 2000 and 5000 or
    select * from <table> where <col>>= 2000 and col <= 5000;

    Both will use index range scan.

  2. #2
    Join Date
    Sep 2003
    Location
    Colombo, Sri Lanka
    Posts
    63

    Re: Oracle Query

    As I know both are the same interms of performance

  3. #3
    Join Date
    Nov 2003
    Location
    Bangalore, INDIA
    Posts
    333

    Re: Oracle Query

    Hi,

    select * from <table> where <col> between 2000 and 5000 or
    select * from <table> where <col>>= 2000 and col <= 5000;

    Both r same in Performance issue
    SATHISH .

  4. #4
    Join Date
    Nov 2003
    Posts
    2

    Re: Oracle Query

    Originally posted by Raja_Arvind
    Is there a performace difference in using between operator and <= and >=. For example, if there is a comparison between 2000 and 5000 which is better:

    select * from <table> where <col> between 2000 and 5000 or
    select * from <table> where <col>>= 2000 and col <= 5000;

    Both will use index range scan.


    I think, the qeury plan generated by the first query will be best rather than second,
    so in this case ur first case is better than the second.

Posting Permissions

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