Question: I wanted to know if some of you have already tried to produce animated bliking text in email html body content.

As we know mail clients do not support **< style>** tag, it's not possible to set css animation keyframe attributes inline, because the animation should be declared. Like this :

```
 @keyframes colorblink { 
  0% { }
  50% { color:black; } 
 }

```

before being called.

How to achieve this for an email html body content? Or you think it's not possible at all?

Answer: 
you can try like below, i think there is column of values which contain city,hotel .. values

```
select * from 
(
select * from query
) src
pivot
 (max(values) for Question in ([City],[Hotel],[Rating],[Comments],[TransportationMode])
 ) pvt

```
You can get the desired output with conditional aggregation:

```
declare @tmp table(
    ReportNumber int, 
    Datecreated  date, 
    Name         varchar(50), 
    Question     varchar(50),
    Answer       varchar(50) 
)

insert into @tmp values 
 (123, '2018-04-24', 'Shane', 'City'               ,'Dallas')
,(123, '2018-04-24', 'Shane', 'Hotel'              ,'Marriott')
,(123, '2018-04-24', 'Shane', 'Rating'             ,'Green')
,(123, '2018-04-24', 'Shane', 'Comments'           ,'Very Good')
,(123, '2018-04-24', 'Shane', 'TransportationMode' ,'Van')
,(124, '2018-04-24', 'Ralph', 'Hotel'              ,'Houston')
,(124, '2018-04-24', 'Ralph', 'City'               ,'Hilton')
,(124, '2018-04-24', 'Ralph', 'Rating'             ,'Yellow')
,(124, '2018-04-24', 'Ralph', 'Comments'           ,'Decent')
,(124, '2018-04-24', 'Ralph', 'TransportationMode' ,'Van')

select ReportNumber, Datecreated, 
 max(case when Question='City'               then Answer else '' end) as City,
 max(case when Question='Hotel'              then Answer else '' end) as Hotel,
 max(case when Question='Rating'             then Answer else '' end) as Rating,
 max(case when Question='Comments'           then Answer else '' end) as Comments,
 max(case when Question='TransportationMode' then Answer else '' end) as TransportationMode
from @tmp 
group by ReportNumber, Datecreated

```

Result:

[![enter image description here](https://i.stack.imgur.com/g59gE.png)](https://i.stack.imgur.com/g59gE.png)