title: SQL Server 2012 : attach two rows of data to one
body: <p>SQL Server stored procedure I am using to get my current dataset:</p>
  
  <pre><code>SELECT 
      DcProd.Title, 
      DcProd.Summary, 
      DcProd.Product, 
      EfProd.ProductStatus, 
      EfProd.ViewOnlyLicenses, 
      EfProd.FullLicenses, 
      DcProd.ProductType, 
      DcProd.Advertise, 
      EfProd.CustomerAccount_Id, 
      DcRelation.component_property_name, 
      DcRelation.child_item_id,  
      DcRelation.child_item_additional_info, 
      DcPageRelation.url_name_    
  FROM 
      [MC_Sitefinity].[dbo].[mastercontrolproducts_mastercontrolproduct] AS DcProd
  LEFT JOIN 
      [MasterControlSitefinity].[dbo].[ProductLicense] AS EfProd ON DcProd.Product = EfProd.Product_Id  --matching dynamic content (Dc) products to Entity Framework (Ef) products
  LEFT JOIN 
      [MC_Sitefinity].[dbo].[sf_dynamic_content] AS DcStatus ON DcProd.base_id = DcStatus.base_id -- show only published and visible. 
  LEFT JOIN 
      [MC_Sitefinity].[dbo].[sf_content_link] AS DcRelation ON DcStatus.original_content_id = DcRelation.parent_item_id --Gets related items for image and page url
  LEFT JOIN 
      [MC_Sitefinity].[dbo].[sf_page_node] AS DcPageRelation ON DcRelation.child_item_id = DcPageRelation.id --gets page url for query
  WHERE
      EfProd.CustomerAccount_Id = 'someid00184' 
      AND DcStatus.visible = 1 
      AND DcStatus.approval_workflow_state_ = 'Published'
  ORDER BY
      ProductType
  </code></pre>
  
  <p>Here is the example data set returned:</p>
  
  <p><a href="http://1drv.ms/1MKjAsU/" rel="nofollow" title="OneDrive Excel Spreadsheet">http://1drv.ms/1MKjAsU</a> (OneDrive excel spreadsheet)</p>
  
  <p>Or if you prefer: <a href="https://onedrive.live.com/redir?resid=26D02110D254A382!317&amp;authkey=!ACe_T3VVcf_pzY4&amp;ithint=file%2cxlsx" rel="nofollow">https://onedrive.live.com/redir?resid=26D02110D254A382!317&amp;authkey=!ACe_T3VVcf_pzY4&amp;ithint=file%2cxlsx</a></p>
  
  <p>Desired result (open to ideas not set in stone):
  <a href="https://onedrive.live.com/redir?resid=26D02110D254A382!320&amp;authkey=!ANxIz3ULXZ9rZvE&amp;ithint=file%2cxlsx" rel="nofollow">https://onedrive.live.com/redir?resid=26D02110D254A382!320&amp;authkey=!ANxIz3ULXZ9rZvE&amp;ithint=file%2cxlsx</a> </p>
  
  <p>This is not all the data returned but some of the key records I am trying to show. </p>
  
  <p>You will notice we have multiple tables. What is happening is for each record on the left there are sometimes two records on the right causing duplicated rows. </p>
  
  <p>What I would like if possible is (looking at last two rows) if we could combine <strong>child_item_additional_info</strong> and <strong>url_name_</strong> on one line instead of two. As for the data in the <strong>component_property_name</strong> it could just be deleted or combined with a pipe (|) or whatever is recommended. </p>
  
  <p>I have looked at cases, pivot tables, but I just am a little green when it comes to SQL and unsure how to do this. </p>
  
  <p>Any help will be greatly appreciated.</p>