Shared Top Border

Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

Login

Login to view more content!!!





Lost Password?
No account yet? Register

Registered Access

Poll

What area of ABAP are you interested in?
 
Home arrow Tips and Tricks arrow ABAP Reports arrow SELECT - Use of the OR-operator
SELECT - Use of the OR-operator PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Anon.   
Friday, 09 March 2007
There are a couple of alternatives when using an OR-operator on a field that is relevant for an index. The below example will illustrate how the Rule based optimizer changes the access path for the query Example:    A database table table1 has an index on field1, field2.

SELECT fieldn INTO v_fieldn
  FROM table1
  WHERE field1 = value1
     AND ( field2 = value2 OR field2 = value3 )
ENDSELECT

The above select will use the index range scan and the access path reflects INLIST ITERATOR CONCATENATED

SELECT fieldn INTO v_fieldn
  FROM table1
  WHERE ( field1 = value1 AND field2 = value2 ) OR
               ( field1 = value1 AND field2 = value3 )
ENDSELECT

The above select will use index unique scan using each of the field2 values and concatenate the result.

Note:  It is the recommended to use the second method.

Related Items:

 
< Prev   Next >

Google Search

Statistics

Contribution Activity
Utilities: 39
Tips and Tricks: 337
Sample Code: 170
Total Contributions: 561

Member Activity
Members: 6341 since 2/1/2007!
New: 1 since yesterday!
Visitors: 1239271
We have 1 guest online

Newest Members

Welcome our newest members:

Google Ads

Shared Bottom Border

Contact Us | Polls | Add URL | Contribute | Privacy | Terms | Feedback

Discussion Forum | BLOG | Consultants: Post your resume | Companies: Advertise on ERPGenie.COM | Post Job
Financials Consultant | Consultant Review | Gallia Consulting | Supply Chain Project | SAP Financials Forum
GenieHoldings.COM, Inc. | Genie Press | WorkflowGenie | ESAGenie | ERPTopSites | ABAP Tips and Tricks | SAP Solutions Database

EDIGenie | Searching Survivor