Now the data and structure of source table(T1) looked like below:
NAME RECORD_NUMBER APPROVERS AREA
MS COORDINATOR 1123 1 EMEA_ARMSTROA c
MS COORDINATOR 1123 3 AMERICAS_SIMSS c
MS COORDINATOR 1123 4 ASIAPACIFIC_KUMSANGA c
MS COORDINATOR 1123 5 ASIAPACIFIC_MSAGE c
MS COORDINATOR 1123 7 ASIAPACIFIC_MSAGE c
then I want to copy data from the table above into a new table(T2) and remove duplicate rows and remove record_number gaps and sort approvers in alphabetic order and reset value of record_number, so the data in the target table should be looked like this:
NAME RECORD_NUMBER APPROVERS AREA
MS COORDINATOR 1123 1 AMERICAS_SIMSS c
MS COORDINATOR 1123 2 ASIAPACIFIC_KUMSANGA c
MS COORDINATOR 1123 3 ASIAPACIFIC_MSAGE c
MS COORDINATOR 1123 4 EMEA_ARMSTROA c
So, can anybody give me a one line sql solution? the primary key of T2 table is (name, record_number, area)