需要根据同一个表中多个列值的组合分配唯一的组ID。价值观有时是独特的。
任何形式的SQL,SSIS,DQS都适用于以下请求。尝试DQS但未到达目的地。表有大约2百万行。
例如first_name
,last_name
和Email_address
值匹配,但PhoneNumber
不同。一切都匹配,但customerId
可能不同。
以下是示例数据。最后一列中的最终输出名为finalgroupid
。
customerid EmailAddress First_Name Middle_Name LastName Address Phone Final Group ID
100 j@A.cooom JNE PIN 1 Wills PL Australia NJ 90210 1111111111 A123
206 JNE PIN 1 Wills PL Australia NJ 90210 A123
206 j@A.cooom JNE PIN 1 Wills PL Australia NJ 90210 1111111111 A123
206 j@A.cooom JNE PIN 1 Wills PLACE Australia NJ 90210 1111111111 A123
206 j@A.cooom JNE PIN 22 OX ST EW #A HURAT MA 30000 1111111111 A123
206 j@A.cooom JNE PIN 22 OX ST EW UNIT A HURAT MA 30000 1111111111 A123
206 j@A.cooom JNE PIN 22 OX ST EW UNIT A HURAT MA 30000 2222222222 A123
206 j@A.cooom JNE PIN C/O I AM THE BEST 35 FABULOUS OUTBACK CT 12345 1111111111 A123
206 j@A.cooom JNE PIN C/O I AM THE BEST 35 FABULOUS OUTBACK CT 12345 2222222222 A123
712 j@A.cooom And PIN 1 MOUNT Everest Frace GA 54358 2222222222 A123
712 j@A.cooom JNE PIN 1 Wills PL Australia NJ 90210 1111111111 A123
791 MA@nose.cooom M H JSN 63 AL RD VALLEY NM 10001 8888888888 A124
791 MA@nose.cooom MAR JSN 21 SUPERHIT CIR BOMBAY HI 11231 8888888888 A124
791 MA@nose.cooom MAR H JSN 63 AL RD VALLEY NM 10001 8888888888 A124
799 MA@hair.cooom M H JSN 63 AL RD VALLEY NM 10001 8888888888 A124
799 MA@hair.cooom MAR H JSN 63 AL RD VALLEY NM 10001 8888888888 A124
799 MA@hair.cooom SEA JSN 21 SUPERHIT CIR BOMBAY HI 11231 8888888888 A124
805 MA@nose.cooom M H JSN 27 W WOOD Mtn VALLEY NM 10000 8888888888 A124
805 MA@nose.cooom MAR H JSN 27 W WOOD Mtn VALLEY NM 10000 8888888888 A124
805 MA@nose.cooom V P C H 21 SUPERHIT CIR BOMBAY HI 11231 8888888888 A124
805 MA@nose.cooom VICTOR HKS 21 SUPERHIT CIR BOMBAY HI 11231 8888888888 A124
805 MA@nose.cooom VICTOR P CAS 21 SUPERHIT CIR BOMBAY HI 11231 8888888888 A124
809 MA@nose.cooom M H JSN 27 W WOOD Mtn VALLEY NM 10000 8888888888 A124
809 MA@nose.cooom MAR STK 21 SUPERHIT CIR BOMBAY HI 11231 8888888888 A124
809 MA@nose.cooom MAR H JSN 27 W WOOD Mtn VALLEY NM 10000 8888888888 A124
815 k@Y.cooom M H JSN 27 W WOOD Mtn VALLEY NM 10000 8888888888 A124
815 k@Y.cooom MAR H JSN 27 W WOOD Mtn VALLEY NM 10000 8888888888 A124
815 k@Y.cooom MAV JSN 21 SUPERHIT CIR BOMBAY HI 11231 8888888888 A124
815 k@Y.cooom MAV JSN 27 W WOOD Mtn VALLEY NM 10000 8888888888 A124
请帮忙。提前谢谢。
答案 0 :(得分:0)
您可以将DENSE_RANK() SQL Server function用于您的要求
这是一个例子
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>