| Posted by Erland Sommarskog on 05/29/07 21:26 
Oonz (arundhaj@gmail.com) writes:> Actually i will combine the multiple numbers into one single record
 >
 > the temporary table structure would be like this
 >
 > No Name Phone   FinalPhone
 > 1    test1     12345  12345
 > 1    test1     23455  12345<br> 23455
 > 2    test2     68638  68638
 > 2    test2     34454  68638<br> 34454<br>
 > 2    test2   45445  68638<br> 34454<br> 45445
 > 3    test3     67684  67684
 > 4    test4     54808  54808
 > 4    test4     74594  54808<br> 74594
 >
 >
 > and by using GROUP BY clause i would select single record having all the
 > information
 >
 >
 > No   Name    FinalPhone
 > 1     test1     12345<br> 23455
 > 2     test2     68638<br> 34454<br> 45445
 > 3     test3     67684
 > 4     test4     54808<br> 74594
 >
 > this view would be sent to UI for display...
 
 GROUP BY is not your guy, in this case. See this link for some ideas on
 to produce concatenated lists:
 http://www.projectdmx.com/tsql/rowconcatenate.aspx
 
 
 --
 Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
 
 Books Online for SQL Server 2005 at
 http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
 Books Online for SQL Server 2000 at
 http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
  Navigation: [Reply to this message] |