Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

problem with logical or

Former Member
0 Likes
620

hi friends i am using OR in a select statement like this :

select single KAWRT from KONV into var2 where KNUMV = var1 and STUNR = 65 or STUNR = 60 .

but what i want is that the result for this should be calculated as

KNUMV =var1 and (STUNR = 65 or STUNR =60)

means result of STUNR = 65 or STUNR =60 should be AND with KNUMV =var1

when i tried like following :

select single KAWRT from KONV into var2 where KNUMV = var1 and STUNR =( 65 , 60)

it is giving error.is there something wrong.

1 ACCEPTED SOLUTION
Read only

amit_khare
Active Contributor
0 Likes
585

Replace '=' with 'IN'..

5 REPLIES 5
Read only

amit_khare
Active Contributor
0 Likes
586

Replace '=' with 'IN'..

Read only

former_member206377
Active Contributor
0 Likes
585

Hi Achal,

Have you tried this ?


      SELECT  SINGLE kawrt
             FROM konv
             INTO var2
             WHERE knumv = var1 AND
                    (  stunr = '65' OR stunr = '60' ) .

Read only

Former Member
0 Likes
585

Hello

Try this:


select single KAWRT from KONV into var2 where 
KNUMV = var1 and ( STUNR = '65' OR STUNR =  '60' ).

Read only

Former Member
0 Likes
585

Hi Anchal,

select single KAWRT from KONV into var2 where KNUMV = var1 and ( STUNR = 65 or STUNR = 60 )

.

Manas M.

Read only

0 Likes
585

hi,

use IN operator instead of EQ.