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
 Other Forums
 MS Access
 Union

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 week1
2. add a column in table B and call it week2
3. append table A and B into table C

appreciate 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
Go to Top of Page

YangAhBang
Starting Member

3 Posts

Posted - 2006-08-24 : 02:33:21
thks tim...

File A... and file A are similar... it contain these fields

name
address
phone no

i 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..
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-08-24 : 03:04:27
[code]INSERT TableC
(
Name,
Address,
PhoneNo
)
SELECT Name,
Address,
PhoneNo
FROM TableA
UNION ALL
SELECT Name,
Address,
PhoneNo
FROM TableB[/code]

Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -