title: SQL Query - To split the value into 2 column and group by same customer
body: <p>I'm new to SQL, I will like to split the value into 2 columns and group it by the same customer. Below is my current table:</p>
  <p>I have tried the query:</p>
  <blockquote>
  <p>Select *</p>
  <p>,Case when [Devices] = 'RF' THEN (Select [Lines] From table_name Else '0' )End As [RF]</p>
  <p>,Case when [Devices] = 'Desktop' THEN (Select [Lines] From table_name Else '0') End As [Desktop]</p>
  <p>From table_name</p>
  </blockquote>
  <p>But it gives me the error : This is not permitted when the subquery follows =, !=, &lt;, &lt;= , &gt;, &gt;= or when the subquery is used as an expression.</p>
  <p>Please advise if anything wrong with the query.
  Thank you!!</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Customer</th>
  <th>Lines</th>
  <th>Devices</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>A</td>
  <td>3</td>
  <td>RF</td>
  </tr>
  <tr>
  <td>A</td>
  <td>4</td>
  <td>Desktop</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>What I expected to see:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Customer</th>
  <th>RF</th>
  <th>Desktop</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>A</td>
  <td>3</td>
  <td>4</td>
  </tr>
  </tbody>
  </table>
  </div>