Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a table having some duplicate rows. I have a requirement that I need only the duplicate rows of the table.
Please find the attached excel with result.
Thanks
Rishi
Try this:
Table:
LOAD Key,
EmployeeId,
EmpName,
EmpSalary,
DateofJoin,
City
FROM
Employee.xlsx
(ooxml, embedded labels, table is Employee);
Right Join (Table)
LOAD Key
Where Count > 1;
LOAD Key,
Count(Key) as Count
Resident Table
Group By Key;
Another option:
Result:
LOAD
Key,
EmployeeId,
EmpName,
EmpSalary,
DateofJoin,
City
WHERE
Check>1;
LOAD Key,
EmployeeId,
EmpName,
EmpSalary,
DateofJoin,
City,
AutoNumber(RecNo(), Key&'|'&EmployeeId&'|'&EmpName&'|'&EmpSalary&'|'&DateofJoin&'|'&City) as Check
FROM
[comm203862.xlsx] (ooxml, embedded labels, table is Employee)
;