Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table (lets call it TableA) that looks like this:
ColA ColB ColC
Red 1 A
Red 1 A
Red 1 A
Blue 2 B
Blue 2 B
Black 3 C
Black 3 D
Black 1 D
What I want to do is to get rid of duplicated rows, so to say I want to load this table or convert it into a new table distinct on all three columns so the result ends up like this:
ColA ColB ColC
Red 1 A
Blue 2 B
Black 3 C
Black 3 D
Black 1 D
How do I do this?
BR
LOAD
Distinct * inline
[
ColA , ColB, ColC
Red , 1 , A
Red , 1 , A
Red , 1 , A
Blue , 2 , B
Blue , 2 , B
Black , 3 , C
Black , 3 , D
Black , 1 , D
];
Use "DISTINCT" Keyword
try this
load
distinct(ColA )
distinct( ColB )
distinct( ColC)
from table ...
LOAD
Distinct * inline
[
ColA , ColB, ColC
Red , 1 , A
Red , 1 , A
Red , 1 , A
Blue , 2 , B
Blue , 2 , B
Black , 3 , C
Black , 3 , D
Black , 1 , D
];
Use "DISTINCT" Keyword