Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
I would like to load a table from excel by avoiding loading rows having the same data within a certain field (etc TELNUMBER).
The table is as shown below:
TELNUMBER NAME ADDRESS
123456 STEVE WALL-STREET
121221 JOHN NEW-YORK
123456 DAVID WALL-STREET
332211 PETER BOSTON
the script should load only the rows 1, 2 and 4.
I'll appreciate your advice on this.
Regards
David
hi david,
Please find the attachment
Hope this will help you
Regards,
Nitin Jain
Add a
WHERE NOT EXISTS(TELNUMBER)
to your LOAD statement. That will restrict the load to the first occurance of each TELNUMBER.
-Rob
Thanks Nitin for the answer.
In case of null in the filed TELNUMBER , I would like to ignore the filltering. Wher should I add the condition in your script?
David
Thnks Rob,
Nice way to remove the duplicate values.
Regards,
Nitin Jain
You don't have to add anything. Nulls will not participate in exists(), so you will get all rows with null TELNUMBER.
-Rob