Mainkey No_in_row JKT001 10 JKT001 20 JKT002 10 JKT003 10 JKT003 20 JKT003 30 JKT003 30 JKT003 40 JKT003 40Notice I can have duplicate mainkey's. The problem I have is that I need to detect whether I have duplicate No_in_row number for the same mainkey. Therefore I want to create an SQL to create a temp table which would show the following results based on the info above:
Mainey Duplicate No_in_Row JKT001 No N/A JKT002 No N/A JKT003 Yes 30 JKT003 YES 40If there was a number of duplicates in each mainkey it would display the no_in row for each duplicate for the same mainkey.