Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to do
Table1:
Load
a_key,
b,
c;
SQL
select * from
......;
where not exists (a_key)
from tab2.qvd;
Or
Load
a_key,
b,
c;
SQL
select * from
......;
MINUS
Tab2.qvd
but looks like syntax is wrong.
Can someone help me here?
Hi,
Is this complete script?
Table1:
Load
a_key,
b,
c;
SQL
select * from
......;
where not exists (a_key)
from tab2.qvd;
Are you trying to load data from SQL where a_key is null? Is that the intention here???
You couldn't apply a exists() to a sql-statement because it's a qv function. Commonly used in such cases is Preceding Load. Another possibilities are to load the sql-table complete and apply then a second load with an exists() filter - see also: The exists issue - or using a join/keep to filter your table.
If your sql-load is quite large it could be useful to convert the exists-logic in a sql-function like SQL: IN Condition.
- Marcus
You should load Table2.qvd and after that the LOAD with exists previous to the SQL:
Table2:
LOAD
a_key,
*
FROM Table2.qvd(qvd);
SQL_Table:
LOAD
a_key, b, c
where exists(a_key, a_key);
SQL SELECT * FROM Table;