Professional Web Applications Themes

Subtables (newbie) - MySQL

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...

  1. #1

    Default Subtables (newbie)

    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
    Josť Carlos Santos Guest

  2. #2

    Default Re: Subtables (newbie)

    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

    [url]http://dev.mysql.com/doc/refman/5.1/en/create-table.html[/url]
    [url]http://dev.mysql.com/doc/refman/5.1/en/insert-select.html[/url]

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    [email]jstucklexattglobal.net[/email]
    ==================
    Jerry Stuckle Guest

  3. #3

    Default Re: Subtables (newbie)

    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.
    >
    > [url]http://dev.mysql.com/doc/refman/5.1/en/create-table.html[/url]
    > [url]http://dev.mysql.com/doc/refman/5.1/en/insert-select.html[/url]
    Thinks. I did a search at [url]http://dev.mysql.com/doc/refman/5.1/en/[/url] before
    posting here, but using the word "subtable". I didn't know that the
    magic word was "insert".

    Best regards,

    Jose Carlos Santos
    Josť Carlos Santos Guest

  4. #4

    Default Re: Subtables (newbie)

    =?ISO-8859-1?Q?Jos=E9_Carlos_Santos?= <jcsantosfc.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: [url]http://dev.mysql.com/doc/refman/5.0/en/[/url]
    MySQL User Forums: [url]http://forums.mysql.com/[/url]
    Axel Schwenke Guest

Similar Threads

  1. A newbie with a newbie question
    By dusty_davis@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 5
    Last Post: October 14th, 07:54 AM
  2. Help for a Newbie
    By SBC Global in forum Macromedia Flash Data Integration
    Replies: 3
    Last Post: June 27th, 11:15 AM
  3. Newbie to ASP.net
    By Clement Kim in forum ASP.NET General
    Replies: 5
    Last Post: August 8th, 12:26 PM
  4. Help a Newbie!
    By Scott Newberry in forum ASP.NET General
    Replies: 2
    Last Post: July 31st, 08:14 AM
  5. Newbie help on G3s
    By Mark in forum Mac Applications & Software
    Replies: 1
    Last Post: July 14th, 06:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139