![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Database Database problems or need to ask a question? maybe something to do with sql injections or a database software question. Database topics cover MySQL, PostgreSQL, Oracle, SQL Server or anything else related to databases. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Hi all: Suppose that I have a table called library concerning the books from a library. If I type SELECT title, author FROM library; I get the two columns of the table which contain the titles and the authors. Is it possible to save this as another table? In other words, I would like to now how to extract a subtable from a table. Best regards, Jose Carlos Santos | |||
|
| Advertisements |
| | #2 | ||
| José Carlos Santos wrote: > Hi all: > > Suppose that I have a table called library concerning the books from a > library. If I type > > SELECT title, author FROM library; > > I get the two columns of the table which contain the titles and the > authors. Is it possible to save this as another table? > > In other words, I would like to now how to extract a subtable from a > table. > > Best regards, > > Jose Carlos Santos http://dev.mysql.com/doc/refman/5.1/...ate-table.html http://dev.mysql.com/doc/refman/5.1/...rt-select.html -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== | |||
|
| | #3 | ||
| On 02-05-2006 12:25, Jerry Stuckle wrote: >> Suppose that I have a table called library concerning the books from a >> library. If I type >> >> SELECT title, author FROM library; >> >> I get the two columns of the table which contain the titles and the >> authors. Is it possible to save this as another table? >> >> In other words, I would like to now how to extract a subtable from a >> table. > > http://dev.mysql.com/doc/refman/5.1/...ate-table.html > http://dev.mysql.com/doc/refman/5.1/...rt-select.html Thinks. I did a search at http://dev.mysql.com/doc/refman/5.1/en/ before posting here, but using the word "subtable". I didn't know that the magic word was "insert". Best regards, Jose Carlos Santos | |||
|
| | #4 | ||
| =?ISO-8859-1?Q?Jos=E9_Carlos_Santos?= <jcsantos@fc.up.pt> wrote: > Suppose that I have a table called library concerning the books from a > library. If I type > > SELECT title, author FROM library; > > I get the two columns of the table which contain the titles and the > authors. Is it possible to save this as another table? > > In other words, I would like to now how to extract a subtable from a > table. In SQL there is no concept like a SUBTABLE. But there is a thing called a VIEW which can be seen as kind of a subtable. Example: CREATE VIEW library_short AS SELECT title, author FROM library; would create the VIEW `library_short`, containing the `title` and `author` columns from table `library`. This VIEW could be used just like an ordinary table in your SQL statements. SELECT * FROM library_short WHERE author LIKE '%Goethe%'; For more details on VIEWs, please consult the MySQL manual and/or a SQL textbook of your choice. HTH, XL -- Axel Schwenke, Senior Software Developer, MySQL AB Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/ MySQL User Forums: http://forums.mysql.com/ | |||
|
| Featured Websites | ||||
|
![]() |
| Tags: newbie, subtables |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| newbie help | Maor71 | PHP | 0 | 07-01-2007 5:28 PM |
| Newbie help | Barry McKean | PHP | 1 | 07-01-2007 5:26 PM |
| PHP newbie help !!! | Andy Yeo | PHP | 3 | 07-01-2007 3:30 PM |
| newbie | jawsquip | Ebay Technical Questions | 8 | 05-30-2007 1:40 AM |
| Newbie | Joe Right | Introduce yourself | 0 | 08-02-2006 6:21 PM |
| Featured Websites | ||||
|