Results 1 to 2 of 2

Thread: Create a View

  1. #1
    Join Date
    Nov 2004
    Posts
    1

    Unanswered: Create a View

    I have a table in a database that has very old and not very relational and I want to create a quick view to show the information in a better way. Let's say that the table has 4 fields : id , child1, child2, child3. I want to create a view from this table that will show two fields: id and child. So, my table currently looks like this:

    id child1 child2 child3

    1 sam bob chris


    and i would like the view to display the information like this......

    id child

    1 sam

    1 bob

    1 chris



    Can anybody help me? Thanks in advance,

    Bob

  2. #2
    Join Date
    Aug 2004
    Posts
    330
    If your DBMS permits a union view, try:

    create veiw view1
    as
    Select id, child1 child
    from table1
    union
    Select id, child2 child
    from table1
    union
    Select id, child3 child
    from table1;

Posting Permissions

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