A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Generally speaking, it is better to do complex formatting in the front end, not in SQL. But you could do
Declare @Sample Table(Rate int, Period char(2));
Insert @Sample(Rate, Period) Values
(50, 'P2'),
(40, 'P4'),
(50, 'P8')
;With cte As
(Select Top 1 With Ties Rate, Period
From @Sample
Order By Rate Desc)
Select Distinct
(Select 'Periods' + Stuff(
(Select ' And ' + c2.Period From cte c2 Order By c2.Period
For XML Path(''),Type)
.value('text()[1]','varchar(max)'),1,4,''))
+ ' have the highest rate of ' + Cast(c1.rate As varchar(11)) As MyResult
From cte c1;
Tom