473,386 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

making two tables with identical schemas appear as one

Hello !

I have a couple of tables with the same schema that I would like to
query and view as one table. I looked into CREATE VIEW and FULL JOINs
but still can't figure out a good (fast) way of doing this..

Any ideas ?

/Otto Blomqvist
Nov 23 '05 #1
3 1262
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
I have a couple of tables with the same schema that I would like to
query and view as one table. I looked into CREATE VIEW and FULL JOINs
but still can't figure out a good (fast) way of doing this..


It depends on the specific way you want to bring the tables together.
Without more specific information nobody will be able to help.

Somehow I suspect you are looking for UNION:

CREATE VIEW
bothTables
AS SELECT
x, y, z
FROM tableA
UNION SELECT
x, y, z
FROM tableB
;

Mit freundlichem Gruß / With kind regards
Holger Klawitter
- --
lists <at> klawitter <dot> de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFBJaMI1Xdt0HKSwgYRAkjQAJ95RawVA5ufaIaY1bITFH AvYsZWwACcCA0c
QKqsbAC1an/JIl/4Ok5mqLU=
=045v
-----END PGP SIGNATURE-----
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2
Do you mean

create view MyView as
select * from table1
union
select * from table2;

John Sidney-Woollett

Otto Blomqvist wrote:
Hello !

I have a couple of tables with the same schema that I would like to
query and view as one table. I looked into CREATE VIEW and FULL JOINs
but still can't figure out a good (fast) way of doing this..

Any ideas ?

/Otto Blomqvist

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #3
On Fri, Aug 20, 2004 at 10:40:43AM +0100, John Sidney-Woollett wrote:
Do you mean

create view MyView as
select * from table1
union
select * from table2;


Be sure to understand the difference between UNION and UNION ALL if you
are going to do this ...

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"No reniegues de lo que alguna vez creíste"
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
by: btober | last post by:
Whenever I create a temporary table, with something like CREATE TEMPORARY TABLE temptable1 AS SELECT * FROM paid.ad_hoc_query; New schemas appear, with names like "pg_temp_1". I guess the...
5
by: Sami | last post by:
Please bear with me, and if you answer this question, please do it step by step. I am new at Access, not at all sophisticated. I am using Office XP. This will need to be read in Access for...
3
by: Joanna Epstein | last post by:
I have several tables formatted as follows: ITEM #, ITEM DESCRIPTION, PL, JANUARY ITEM #, ITEM DESCRIPTION, PL, FEBRUARY And so on… I need to create a final report that merges all of the...
5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
1
by: Carl B Davis | last post by:
Help please!!! I am an intermediate access user that is getting my bottom kicked by what seems an easy problem to fix. I maintain an employee database at work. I have set up a query from two tables...
5
by: m.e.bruche | last post by:
Hi, In my database, I created a lot of tables before I found out about schemas. It's a mess! Suppose I want to get organised, and create a couple of schemas. How do I move existing tables...
2
by: Griff | last post by:
I've a (classic) ASP web page that has several tables on it that have identical columns (headings). When these tables are displayed they of course have different widths, based upon the amount of...
0
by: Dan | last post by:
Issue making textbox visible based on specific input from a radio button list in an EditItemTemplate I want to setup a gridview that when in edit mode and when the user selects "Other" from a...
12
by: nyathancha | last post by:
Hi, I have a question regarding best practices in database design. In a relational database, is it wise/necessary to sometimes create tables that are not related to other tables through a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.