07-31-2008 9:15 AM
hi guyz,
im wondering if therez anyway to compare two values for the same field in the where condition of select statement. plz advise..
thanks
07-31-2008 9:20 AM
Hi,
If you are talking about specifying two values for the same field in the WHERE condition in the SELECT statement, Yes it is possible.
update sflight
set fldate = w_date
where carrid in ('AA','LH')
and connid in ('0010','0011').
If you want to compare two fields in the Select statement,
SELECT
WHERE (CARRID EQ 'AA' OR CARRID EQ 'LH').
07-31-2008 9:20 AM
Use-
select xyz
from xyz
into xyz
where ( field eq value1 or field eq value2 )
Regards,
Aparna Gaikwad
07-31-2008 9:20 AM
Hi,
You can use two times the same field in the where clause with different values for the field.
Thanks
Sudharshan
07-31-2008 9:20 AM
hi,
did you try?
SELECT ...
WHERE ( field EQ a OR field EQ b )
or is it not your question?
ec
07-31-2008 9:20 AM
Hi,
If you are talking about specifying two values for the same field in the WHERE condition in the SELECT statement, Yes it is possible.
update sflight
set fldate = w_date
where carrid in ('AA','LH')
and connid in ('0010','0011').
If you want to compare two fields in the Select statement,
SELECT
WHERE (CARRID EQ 'AA' OR CARRID EQ 'LH').
07-31-2008 9:21 AM
hiii
yse you can use it like below query.
SELECT matnr " Material Number
FROM mara
INTO TABLE i_mara
WHERE matnr = '000000000000002132'
OR matnr = '000000000000002137'.
regards
twinkal
07-31-2008 9:21 AM
Hi,
Yes we can do it using IN operator.
SELECT...FROM ... INTO TABLE ....
WHERE field IN ( 'Value1' , 'value2' )
AND....
Thanks,
Vinod.
07-31-2008 9:21 AM
hi,
use self mapping using Alias.
1.make an inner join of a table with alias *a* once and *b* again.
2.Now compare a-field EQ b-field.
Regards,
anirban
07-31-2008 9:22 AM
Hi!
SELECT * FROM mara
INTO TABLE gt_mara
WHERE matnr ='A' OR matnr = 'B'.
Regards
Tamá
07-31-2008 9:22 AM
Hi,
Select * from mara
into table gt_mara
where MTART IN ( 'ZA' , 'ZB' ).
Best regards,
Prashant
07-31-2008 9:36 AM
HI,
Yes, you can compere two values for the same field in WHERE clause of SELECT statement.
SELECT <field1> <field2>... from <table> into table <Internal Table> where
<field1> = <val1> OR
<field1> = <var2> OR
<field1> = <val3>.
or
SELECT <field1> <field2> ... from <table> INTO TABLE <internal table> where
<field1> IN <val1, val2, val3 ...).
Hope this will be useful.
Cheers
Ramaraju