在SQL中,是否有办法为“链接组”创建ID?
Source Table +----+-----+ | Id | Id | +----+-----+ | 1 | 2 | | 1 | 3 | | 2 | 3 | | 4 | 5 | +----+-----+ Desired Result Table +----+-----+-----------+ | Id | Id | Group Id | +----+-----+-----------+ | 1 | 2 | A | | 1 | 3 | A | | 2 | 3 | A | | 4 | 5 | B | +----+-----+-----------+
见图