title: SQL Replace duplicate entries with blanks
body: <p>I have a SQL Table like this one:</p>
  
  <p><img src="https://i.stack.imgur.com/wrbqw.jpg" alt="SQl table"></p>
  
  <p>and I want the output to be like this:</p>
  
  <p><img src="https://i.stack.imgur.com/tQDrY.jpg" alt="Output"></p>
  
  <p>Basically:</p>
  
  <ul>
  <li>replace duplicates with blanks but
  
  <ul>
  <li>if <strong>col6</strong> value is different from the previous row for the same
  <strong>col1</strong>
  value, all the data fields should be included.</li>
  </ul></li>
  <li>col10 values are blank.</li>
  <li>col12 is removed.</li>
  </ul>
  
  <p>I am struggling to create a query. 
  I found this: <a href="https://stackoverflow.com/questions/13742572/how-to-show-blank-record-in-sql-if-duplicate-rows-exists">CTE answer</a></p>
  
  <p>and tried to run the following:</p>
  
  <pre><code>;WITH CTE
  AS
  ( 
     SELECT DBA.s12.*,
       ROW_NUMBER() OVER(PARTITION BY DBA.s12.col6 ORDER BY(SELECT 1)) rownum
    FROM DBA.s12
  )
  SELECT
     DBA.s12.col1,
     DBA.s12.col2,
     DBA.s12.col3,
     DBA.s12.col4,
     DBA.s12.col5,
     DBA.s12.col7, 
     DBA.s12.col8,
     DBA.s12.col9,
     DBA.s12.col10,
     DBA.s12.col11,
     DBA.s12.col12,
    CASE rownum
      WHEN 1 THEN DBA.s12.col6
      ELSE ''
    END AS col6
  FROM CTE
  ORDER BY DBA.s12.col1;
  </code></pre>
  
  <p>but I get an error <code>"Could not execute statement. Syntax error or access violation"</code></p>
  
  <p>Can anyone shed some light on where my query has a syntax error/access violation or have a better method to extract the data?</p>