I have a table like this one:

```
+------------+---------------+--------------------------+---------+
| GeneralKey |     Label     |         Extended         | OrderID |
+------------+---------------+--------------------------+---------+
|         63 | Take-Off      | Project Status           |       1 |
|         64 | Hold          | Project Status           |       3 |
|         65 | Pending       | Project Status           |       5 |
|         66 | Contracted    | Project Status           |       6 |
|         67 | Dead          | Project Status           |       7 |
|         86 | Pricing       | Project Status           |       4 |
|         99 | Bid Request   | Project Status           |       0 |
|        100 | Take-Off      | Design Contracted Status |       0 |
|        101 | Hold          | Design Contracted Status |       2 |
|        102 | Pricing       | Design Contracted Status |       3 |
|        103 | Issued        | Design Contracted Status |       4 |
|        104 | In-House      | Design Contracted Status |       5 |
|        105 | Shops/layouts | Project Status           |       2 |
|        106 | Shops/layouts | Design Contracted Status |       1 |
+------------+---------------+--------------------------+---------+

```

And I have stored procedure to use this table like:

```
BEGIN

        DECLARE @Parameter1 VARCHAR(50)
        DECLARE @Parameter2 VARCHAR(50);
        ;WITH CTE
            AS (SELECT
                    *
                   , ROW_NUMBER() OVER(ORDER BY
                                          (SELECT
                                                NULL
                                          )) AS [rn]
                    FROM STRING_SPLIT(@Extended , ','))
            SELECT
                 @Parameter1 = MAX(CASE
                                   WHEN [rn] = 1
                                   THEN VALUE
                                END)
                , @Parameter2 = MAX(CASE
                                   WHEN [rn] = 2
                                   THEN VALUE
                                END)
                 FROM [CTE]

        SELECT
             [GeneralKey]
            , [Label]
             FROM [General]
             WHERE [Extended] = (SELECT
                                   @Parameter1)
                  OR [Extended] = (SELECT
                                     @Parameter2)
             GROUP BY
                    [Label]
                   ,[GeneralKey]
                   , [OrderID]
             ORDER BY
                    [OrderID];
    END

```

The problem is when I execute it with `exec` instruction

```
usp_Get_StatusListByDesignType @Extended = 'Project Status,Design Contracted Status'

```

It returns repeated `Label` values:

```
+------------+---------------+
| GeneralKey |     Label     |
+------------+---------------+
|         99 | Bid Request   |
|        100 | Take-Off      |
|         63 | Take-Off      |
|        106 | Shops/layouts |
|        105 | Shops/layouts |
|        101 | Hold          |
|        102 | Pricing       |
|         64 | Hold          |
|        103 | Issued        |
|         86 | Pricing       |
|        104 | In-House      |
|         65 | Pending       |
|         66 | Contracted    |
|         67 | Dead          |
+------------+---------------+

```

As you can see I have repeated values(Label), `GROUP BY` clause isn't working on stored procedure. What am I doing wrong? Regards

**UPDATE** 

As comments bellow I try to include GeneralKey with aggregate function like:

```
 SELECT
                 SUM([GeneralKey])
                , [Label]
                 FROM [General]
                 WHERE [Extended] IN (@Parameter1, @Parameter2)
                GROUP BY 
                [Label]
                ,[OrderID]
                 ORDER BY
                        [OrderID];

```

But I get same results