Application Development 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: 

Problem when using SQL EXISTS clause

luis_rod
Participant
0 Kudos
327
Hi all,

I am having some problems with the EXISTS clause in SQL.
If I write:
  SELECT * FROM ztable_1 INTO TABLE @DATA(itab_1).

The statement works perfectly BUT, if I write:

  SELECT a~* FROM ztable_1 as a INTO TABLE @DATA(itab_1)
WHERE NOT EXISTS (
SELECT b~key FROM ztable_2 as b WHERE a~key = b~key ).

The rows that DO NOT exist get written into itab_1, but some of them get displaced to the right as one of the key columns of ZTABLE_2 “overlay” the first column of itab_1.

Any ideas? We are running 7.5.

TIA,
Luis


0 REPLIES 0