Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've a select statement of the following syntax:
Table:
load *
from table.qvd
where id = 1 or 2 or 3;
Because the list of applicable IDs is considerably long I'd like to simplify the statement to something like
Table:
load *
from table.qvd
where id in IDlist;
Any ideas on how to achieve this?!
Where Exists (IDlist, ID)
Where IDlist is a table like below
Load * Inline
[
IDlist
1
2
3
];
Where Exists (IDlist, ID)
Where IDlist is a table like below
Load * Inline
[
IDlist
1
2
3
];
Exists() ?
might be you can use
where Id >=1 and <=50
if its in sequence!
Hi Manish,
this is exactly what I was looking for!
Now instead of using inline tables I'll look if I can just import the relevant ID's from my source files.
Thanks a bunch!
Hi Manish,
one more question.. although the script runs..
the Where Exists(IDlist, ID) statement doesn't yield the return that
where id = 1 or 2 or 3 does...
In fact it seems the exists function doesn't find any matches?
Try this sample..
Load * Inline
[
IDList
1
2
3
];
Load * Inline
[
Customer, ID
A, 1
B, 2
C, 3
D, 4
E, 5
F, 6
]
Where Exists (IDList, ID);
Drop Field IDList;