on 06-26-2018 12:03 PM
hi all,
iam trying to use coalesce function in IN condition
et_res = select carrid from scarr as a
where carrid in(
select
coalesce( (select carrid from sflight),
(select carrid from scarr))
as carrid FROM scarr);
please help me solve this issue
Hello.
Your select statement is impossible to run because what you writing is subquery after SELECT statement, not after WHERE.
in this case I think you should use JOIN instead of COALESCE. or you can try bellow query ( im not sure if it fit your requirement) ( if carrid not found, then will replaced by '--' which is special symbol then first subquery will fail, you can try another symbol 😞
SELECT carrid FROM scarr
WHERE carrid IN ( SELECT COALESCE( carrid, '--' ) FROM sflight ) OR
carrid IN ( SELECT COALESCE( carrid, '--' ) FROM scarr )
INTO TABLE @DATA(itab).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.