<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Problem when using SQL EXISTS clause in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-sql-exists-clause/m-p/12609549#M2011670</link>
    <description>Hi all,
  &lt;BR /&gt;
  &lt;BR /&gt;I am having some problems with the EXISTS clause in SQL.
  &lt;BR /&gt;If I write:
  &lt;BR /&gt;
  &lt;PRE&gt;&lt;CODE&gt;  SELECT * FROM ztable_1 INTO TABLE @DATA(itab_1).&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;BR /&gt;The statement works perfectly BUT, if I write:
  &lt;BR /&gt;
  &lt;BR /&gt;
  &lt;PRE&gt;&lt;CODE&gt;  SELECT a~* FROM ztable_1 as a INTO TABLE @DATA(itab_1)&lt;BR /&gt;    WHERE NOT EXISTS (&lt;BR /&gt;      SELECT b~key FROM ztable_2 as b WHERE a~key = b~key ).&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;BR /&gt;
  &lt;P&gt;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. &lt;/P&gt;
  &lt;P&gt;Any ideas? We are running 7.5.&lt;/P&gt;TIA,
  &lt;BR /&gt;Luis
  &lt;BR /&gt;
  &lt;BR /&gt;
  &lt;BR /&gt;</description>
    <pubDate>Mon, 14 Nov 2022 14:38:49 GMT</pubDate>
    <dc:creator>luis_rod</dc:creator>
    <dc:date>2022-11-14T14:38:49Z</dc:date>
    <item>
      <title>Problem when using SQL EXISTS clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-sql-exists-clause/m-p/12609549#M2011670</link>
      <description>Hi all,
  &lt;BR /&gt;
  &lt;BR /&gt;I am having some problems with the EXISTS clause in SQL.
  &lt;BR /&gt;If I write:
  &lt;BR /&gt;
  &lt;PRE&gt;&lt;CODE&gt;  SELECT * FROM ztable_1 INTO TABLE @DATA(itab_1).&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;BR /&gt;The statement works perfectly BUT, if I write:
  &lt;BR /&gt;
  &lt;BR /&gt;
  &lt;PRE&gt;&lt;CODE&gt;  SELECT a~* FROM ztable_1 as a INTO TABLE @DATA(itab_1)&lt;BR /&gt;    WHERE NOT EXISTS (&lt;BR /&gt;      SELECT b~key FROM ztable_2 as b WHERE a~key = b~key ).&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;BR /&gt;
  &lt;P&gt;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. &lt;/P&gt;
  &lt;P&gt;Any ideas? We are running 7.5.&lt;/P&gt;TIA,
  &lt;BR /&gt;Luis
  &lt;BR /&gt;
  &lt;BR /&gt;
  &lt;BR /&gt;</description>
      <pubDate>Mon, 14 Nov 2022 14:38:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-using-sql-exists-clause/m-p/12609549#M2011670</guid>
      <dc:creator>luis_rod</dc:creator>
      <dc:date>2022-11-14T14:38:49Z</dc:date>
    </item>
  </channel>
</rss>

