MySQL Forums
Forum List  »  Newbie

Re: related tables automatically
Posted by: Phillip Ward
Date: June 02, 2014 05:29AM

Quote

I have a data base and a big table with 8 fields, and now i need to create a new table only with 3 fields, in that all the fields will be records automatically from the big table.
I would expect that you can get the data you want from the "big" table by using a "select" statement.
If you can do that, then you just have to give that statement a Name, i.e. turn it into a View.

If this gets you the data you want ...
   select   column1, column2, column3 
   from     big_table 
   where    ... some_condition ... 
   order by column1 ;

... then this makes it more "permanent" ...
   create view little_table as 
   select   column1, column2, column3 
   from     big_table 
   where    ... some_condition ... 
   order by column1 ;

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: related tables automatically
June 02, 2014 05:29AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.