title: Sql pivot - but dont sum the values
body: <p>I have a table schema that looks like this</p>
  
  <pre><code>CREATE TABLE [dbo].[Discounts](
        [Id] [int] NOT NULL,
        [ProductId] [varchar(50)] NOT NULL,
        [LowerBoundDays] [int] NOT NULL,
        [UpperBoundDays] [int] NOT NULL,
        [Discount] [decimal](18, 4) NOT NULL,
  </code></pre>
  
  <p>And some data like this</p>
  
  <pre><code>        lower       upper discount(%)
  product1  0         10          0
  product1  10        30          1
  product1  30        60          2
  product1  60        90          3
  product1  90        120         4
  product2  0         10          0
  product2  10        30          1
  product2  30        60          2
  product2  60        90          3
  product2  90        120         4
  </code></pre>
  
  <p>How can I do a pivot query to get 2 rows that look like this:</p>
  
  <pre><code>            0-10    10-30   30-60   60-90   90-120
  product1    0       1       2       3       4
  product2    0       1       2       3       4
  </code></pre>