Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 SQL CODE

Author  Topic 

tjbarr
Starting Member

8 Posts

Posted - 2008-07-08 : 14:50:13
suppose I have a table:

TableA

Field1 Name Tammy
Field2 email t.barr@
Field2 email tbc@
Field2 email tjb@

If I do a query: select * from tableA:
I'll get col1 col2
Tammy t.barr@
Tammy tbc@
Tammy tjb@
How can I construct an sql query that will display the fields where there is no redundancy.
e.g. col1 col2 col3 col4
row 1 Tammy t.barr@ tbc@ tjb@

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-07-08 : 15:15:34
moved from script library.

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.0 out!
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-07-08 : 15:16:21
search for pivot around here.

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.0 out!
Go to Top of Page
   

- Advertisement -