• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Creating a view combining two columns into one

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I have two tables as shown below, could anyone tell me if and how its possible to create a view
that has only one column that contains the dbName values from both the tutor and student tables?

Thanks in advance

CREATE TABLE tutor
(
dbId INTEGER ,
dbName VARCHAR(20),
dbEmail VARCHAR(20),
dbPassword VARCHAR(8)NOT NULL
);



CREATE TABLE student
(
dbId INTEGER NOT NULL PRIMARY KEY,
dbName VARCHAR(20),
dbCourse VARCHAR(20),
dbPassword VARCHAR(8) NOT NULL,
dbPersonalTutorId INTEGER NOT NULL
);
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Paul,

Look into using two queries combined with UNION.... and check into the difference between UNION and UNION ALL, to be sure you use the right one.

Hope this helps,
-- Jon
reply
    Bookmark Topic Watch Topic
  • New Topic