Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Merging Columns in a table

Status
Not open for further replies.

victorthomas

Programmer
Nov 26, 2003
12
US
I have a need to merge data columns in a table. I'm using rightfax and I need to merge data in a FAX column and in an E-MAIL column both columns are text columns. Here is an example from table tbl.Customers:

INITIAL TABLE CONTENT:
NAME FAX E-MAIL
----- --------- ------
USER1 6121234567 USER1@HOTMAIL.COM
USER2 <NULL> USER2@MSN.COM
USER3 6128889999 <NULL>
USER4 9523456789 USER4@YAHOO.COM


FINAL RESULT SET I WOULD LIKE TO ACHIEVE:
NAME FAX/E-MAIL
----- ----------
USER1 6121234567
USER1 USER1@HOTMAIL.COM
USER2 USER2@MSN.COM
USER3 6128889999
USER4 9523456789
USER4 USER4@YAHOO.COM

My SQL Kung-fu not that good, can someone please assist me by giving me some guidance on this issue?

Thank you,

Victor Thomas
 
SELECT Name, Fax AS Fax_Email
FROM YourTable
UNION
SELECT Name, Email
FROM YourTable


--Angel [rainbow]
-----------------------------------
Behold! As a wild ass in the desert
go forth I to do my work.
--Gurnie Hallock (Dune)
 
Thanks Angel, sorry about the late reply I'm also an admin and all hell broke loose on my network took a while to get a couple of minutes to get back to this SQL project.

I really appreciate your reply! I'll give a shot and let you know the results.

Victor Thomas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top