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

SELECT statement

Former Member
0 Likes
745

Hi All,

I need to specify 2 conditions for BTRTL in select statement like btrtl should only be equal to both '1000' and '1001'.

How can we do this in a select statement.

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
727

Hi

u can use BTRTL NE 1000 and BTRTL NE 1001

or

Not BTRTL in ('1000', '1001')

6 REPLIES 6
Read only

Former Member
0 Likes
728

Hi

u can use BTRTL NE 1000 and BTRTL NE 1001

or

Not BTRTL in ('1000', '1001')

Read only

0 Likes
727

Hi,

Thanks for the reply.

In my case btrtl equals to 1000 and 1001.

How can we do for this?

Thanks

Read only

0 Likes
727

WHERE BTRTL in ('1000','1001') OR Where (BTRTL EQ 1000 OR BTRTL EQ 1001)

u can use this, it acts union - pick all the values where BTRTL is equal to 1000 or BTRTL is equal to 1001.

At same time single record cannot hold both values 1000 & 1001 in BTRTL rite

Read only

0 Likes
727

Thanks everyone,i solved it

thank you very much

Read only

Former Member
0 Likes
727

> I need to specify 2 conditions for BTRTL in select statement like btrtl should only be equal to both '1000' and '1001'.

where ( BTRTL = '1000' or

BTRTL = '1001' ).

SOME THING LIKE THIS..

SELECT * FROM SFLIGHT

INTO FLIGHT

UP TO 1 ROWS

WHERE ( CARRID = 'AS' OR CARRID = 'BB' ).

ENDSELECT.

Read only

Former Member
0 Likes
727

WHERE BTRTL in ('1000','1001')