As Olaf noted, giving us the DDL and DML and desired result helps us help you. Without that, we are oftentimes guessing what you want, but if you give us that, we can often provide a tested solution. So the following is a guess at what you want as well as an example of how you might provide the DDL and DML and desired result.
Create Table YourTableName(ligne varchar(20), masseProduit int);
Insert YourTableName Values
('CT150', 25),
('CT250', 75),
('CT-TANDEM', 300),
('ST1', 125),
('ST2', 275),
('ST-TANDEM', 3300),
('RT25', 999);
;With cte As
(Select Left(t.ligne, 2) + '-TANDEM' As ligne, t.masseProduit
From YourTableName t
Where Exists (Select * From YourTableName t1 Where Left(t.ligne, 2) + '-TANDEM' = t1.ligne))
Select ligne, Sum(masseProduit) As masseProuditSum
From cte
Group By ligne;
/* Desired Result
ligne masseProuditSum
CT-TANDEM 400
ST-TANDEM 3700
*/
Tom