If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Create a View

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-15-04, 15:36
nailers67 nailers67 is offline
Registered User
 
Join Date: Nov 2004
Posts: 1
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
Reply With Quote
  #2 (permalink)  
Old 11-15-04, 15:56
urquel urquel is offline
Registered User
 
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;
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

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