Using combination of “AND” and “OR” in SELECT in ABAP

SAP HANASAPSAP Basis

You can use the following query:

SELECT * FROM my_table
WHERE condition 1
AND condition 2
AND ( id EQ '2' or id EQ ‘3’ ).

Note: There should be space after and before bracket.

Alternatively you can use IN statement as below:

SELECT * FROM my_table
WHERE condition 1
AND condition 2
AND EQ IN ('2', ‘3’ ).




raja
Published on 16-Dec-2017 01:01:16
Advertisements