title: sql server pivot data without aggregate function and print all values in column
body: <p>Trying to figure how to write a pivot sql server statement. I have following table</p>
  <p>Source Table</p>
  <pre><code>ID |Product |Event        |Date 
  -----------------------------------------------
  1  |Laptop  |Search       |2020-07-17 14:41:13.535
  1  |Laptop  |Product Page |2020-07-17 14:41:13.535
  1  |Laptop  |Bought       |2020-07-17 14:41:13.535
  1  |Tablet  |Search       |2020-07-18 14:41:13.535
  1  |Tablet  |Product Page |2020-07-18 14:41:13.535
  1  |Tablet  |Bought       |2020-07-18 14:41:13.535
  </code></pre>
  <p>Desired Output</p>
  <pre><code> ID|   Product |Search                  |Product Page             |Bought
  -----------------------------------------------------------------------------------------------
   1 |   Laptop  |2020-07-17 14:41:13.535 |2020-07-17 14:41:13.535  |2020-07-17 14:41:13.535
   1 |   Tablet  |2020-07-18 14:41:13.535 |2020-07-18 14:41:13.535  |2020-07-18 14:41:13.535
  </code></pre>
  <p>My Query looks like</p>
  <pre><code>with V1 as 
  (
  select id,product,event,start_time_local
  from table1
  )
  select id,product,
  [search],[product page],[Bought] from V1
  PIVOT (Max(start_time_local) for event_type in ([search],[product page],[Bought]))
  as PivotTable;
  </code></pre>
  <p>When i take Max(date) it returns with only max value wherein i want to display all dates.</p>