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.
Author |
Topic |
YangAhBang
Starting Member
3 Posts |
Posted - 2006-08-24 : 02:02:00
|
hello...i was introduce to the forum.. and today is my first attemp to seek help here...can someone show me how to write a union statement in SQL...i need to 1. add a colume in table A and name it week12. add a column in table B and call it week23. append table A and B into table Cappreciate any help.. |
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2006-08-24 : 02:17:14
|
That's a bit cryptic....Why not show us what data you have and how you'd like it to come out?Tim |
 |
|
YangAhBang
Starting Member
3 Posts |
Posted - 2006-08-24 : 02:33:21
|
thks tim...File A... and file A are similar... it contain these fieldsnameaddressphone noi would like to append all these into file C, and in the final file C i would need to include that these names belong to file A and B respectivly...i hope i answer u.. and thks so much in advance.. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-08-24 : 03:04:27
|
[code]INSERT TableC ( Name, Address, PhoneNo )SELECT Name, Address, PhoneNoFROM TableAUNION ALLSELECT Name, Address, PhoneNoFROM TableB[/code]Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|