2008 Feb 20 7:04 AM
hello friends , i have one simple doubt
tables:plpo,plfh.
select * from plpo
where plnty = 'N'
and plnNR = group_number "'CEWGRP'
and vornr = W_ASSIGN_PRT-OPERATION_NUMBER.
endselect.
select * from plfh where
plnty = 'N'
and plnnr = group_number
and plnkn = plpo-plnkn
and loekz = 'x'.
endselect.
for the last select query i want that query should take records with both loekz = 'x' and loekz ne 'x' ..so waht can i do without changing any field above loekz....might be something like
(where loekz id deletion indicator)
select * from plfh where
plnty = 'N'
and plnnr = group_number
and plnkn = plpo-plnkn
and loekz = 'x' or loekz ne 'x'...is something like this possible?means it shd take into consideration both records with x and without x.
2008 Feb 20 7:14 AM
Hi,
You can write in 3 ways.
1.
select * from plfh where
plnty = 'N'
and plnnr = group_number
and plnkn = plpo-plnkn
and ( loekz = 'x' or loekz EQ '' ).
2. select * from plfh where
plnty = 'N'
and plnnr = group_number
and plnkn = plpo-plnkn
and loekz IN ( 'x' ,' ' ).
3.
select * from plfh where
plnty = 'N'
and plnnr = group_number
and plnkn = plpo-plnkn.
2008 Feb 20 7:06 AM
2008 Feb 20 7:08 AM
Yes You can use that... but what is the necessity to include both with 'X' and ' '.
instead u can use loekx = 'X' or loekx = ' '.
2008 Feb 20 7:10 AM
Hello,
loekz is a deletion indicator. So it can have value 'X' or space.
In order to pick up records you can ignore loekz from select query.
Regards,
preeti.
2008 Feb 20 7:10 AM
Remove loekz from ur select query.So irrespective of loekz value,it ll select the data
select * from plfh where
plnty = 'N'
and plnnr = group_number
and plnkn = plpo-plnkn
.
will work....
Reward if useful.
Regards
Rudra
2008 Feb 20 7:14 AM
Hi,
You can write in 3 ways.
1.
select * from plfh where
plnty = 'N'
and plnnr = group_number
and plnkn = plpo-plnkn
and ( loekz = 'x' or loekz EQ '' ).
2. select * from plfh where
plnty = 'N'
and plnnr = group_number
and plnkn = plpo-plnkn
and loekz IN ( 'x' ,' ' ).
3.
select * from plfh where
plnty = 'N'
and plnnr = group_number
and plnkn = plpo-plnkn.
2008 Feb 20 7:31 AM
hi ,
Dont take that field in ur where condition if u want to have both the values x and space.
if there are some other values for that field other than X and space ,u should write
field ='X' or field = space in where clause.
pls reward if helpful.
regards,
Deepa
2008 Feb 20 7:51 AM
thanks a lot muralikrishna k.
it was a very nice answer by u which helped me to solve my problem.
and thank u all for replying to my thread.