Garayed.com  

Go Back   Garayed.com > mySQL
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-23-2007, 02:22 AM
Kevin
 
Posts: n/a
Default creating a new table from content from two or more existing tables?

Hi guys,

Here is the question:
If we have table t1 and t2 having exact the same columns.
And we want to create a new table t3, whose content is the combine
(union) of the content of t1 and t2, how can we write the sql?

I tried:
create table t3 (select * from t1, t2);
create table t3 (select * from t1 union all select * from t2);

Both are not working. :-(
Any ideas?

Thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-23-2007, 11:35 AM
Captain Paralytic
 
Posts: n/a
Default Re: creating a new table from content from two or more existing tables?

On 23 Jul, 03:22, Kevin <happy_singap...@yahoo.com.sg> wrote:
> Hi guys,
>
> Here is the question:
> If we have table t1 and t2 having exact the same columns.
> And we want to create a new table t3, whose content is the combine
> (union) of the content of t1 and t2, how can we write the sql?
>
> I tried:
> create table t3 (select * from t1, t2);
> create table t3 (select * from t1 union all select * from t2);
>
> Both are not working. :-(
> Any ideas?
>
> Thanks.


Sorry my crystal ball appears to be faulty. Look as I might I just
can't see in what way the 2 queries are not working!

Maybe you could tell us!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:32 AM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.