Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have two tables:
MainTable:
MemberId
1
2
3
ExcludeTable:
MemberId
1
How to use script to exclude memberid 1?
I just want to get 2,3
Thanks.
Use the exists() function.
ExcludeTable:
Load MemberId as MemberId_Exclude
From ExcludeTable;
MainTable:
Load MemberId
From MainTable
Where not exists(MemberId, MemberId_Exclude);
Regards.
Hi,
But I use SQL not load, how can I use Exist function?
SQL select MemberId as ExcludeMemberId
FROM Test.dbo.ExcludeMember;
SQL select MemberId
FROM Test.dbo.MemberId
;
you can use this as your basis:
LOAD *,
if(Exists(Field1,Field2),Field2)
Resident TableName;
Nothing prevents you from using preceding load:
ExcludeTable:
SQL select MemberId as ExcludeMemberId
FROM Test.dbo.ExcludeMember;
MainTable:
LOAD MemberId
Where not exists(MemberId, MemberId_Exclude);
SQL select MemberId
FROM Test.dbo.MemberId;
Sorry, what's the meaning of ' MemberId_Exclude'?
thats the alias of the MemberId you loaded from
Test.dbo.ExcludeMember