Remove duplicates groups I have a many-to-many relationship table (bridge table) (TicketId, CiiD) and I want to transform it into the following model : (IdBridge, Ciid),
actually my problem is how to remove the duplicates groups ! 
here is an exemple code for source table (TicketCis):
TicketCis
CREATE TABLE TicketCIs
(
      TicketId varchar(5)
      ,CIId varchar(5)
);

INSERT INTO TicketCis (TicketId, CiiD)
VALUES 
('A','AA'),
('A','AB'),
('B','AA'),
('C','AC'),
('C','AD'),
('D','AA'),
('E','AC'),
('E','AD'),
('F','AF');

so I proceed to grouping by TicketId with adding ID_GROUP with this query:
SELECT
DENSE_RANK() OVER(ORDER BY TicketId) AS ID_GROUP,
     CIId
FROM TicketCIs

The output I'm getting:
╔══════════╦═══════╗
║ ID_GROUP ║ CIId  ║
╠══════════╬═══════╣
║    1     ║  AA   ║
║    1     ║  AB   ║ 
║    2     ║  AA   ║
║    3     ║  AC   ║
║    3     ║  AD   ║
║    4     ║  AA   ║
║    5     ║  AC   ║
║    5     ║  AD   ║
║    7     ║  AF   ║
╚══════════╩═══════╝ 

The output I'd like to get:
╔══════════╦═══════╗
║ ID_GROUP ║ CIId  ║
╠══════════╬═══════╣
║    1     ║  AA   ║
║    1     ║  AB   ║ 
║    2     ║  AA   ║
║    3     ║  AC   ║
║    3     ║  AD   ║
║    6     ║  AF   ║
╚══════════╩═══════╝ 

In the output (what I'm looking for) as you can see, the duplicate group_ids (4,5) are removed.
I hope it's clearer now :)
Thank you.
You can use the COUNT() OVER window function and PARTITION by your ID_GROUP field (in a series of CTEs) to filter on in the final query.
WITH CTE_Group AS
(
    SELECT
        DENSE_RANK() OVER(ORDER BY TicketId) AS ID_GROUP,
        CIId
    FROM TicketCIs
),
CTE_Group_Distinct AS
(
    SELECT
        ID_Group,
        CIId,
        COUNT(CIId) OVER (PARTITION BY ID_GROUP) AS DupeCount
    FROM CTE_Group 
)

SELECT ID_GROUP, CIId
FROM CTE_Group_Distinct
WHERE DupeCount = 1