By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,084 Members | 1,969 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,084 IT Pros & Developers. It's quick & easy.

combining rows from 2 tables

P: n/a
jt
Is there a way to create a view that combines all rows from 2 tables
that have the same columns/fields?

thanks,
Judi
Jul 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

create view <view> (col1, ... col<n>) as

select col1, ... col<n> from tab1

union

select col1, ... col<n> from tab2

/
--
Posted via http://dbforums.com
Jul 19 '05 #2

P: n/a
Jan
SELECT col1, col2 ...
FROM table_A
UNION
SELECT col1, col2 ...
FROM table_B
Jul 19 '05 #3

P: n/a
ju**********@yahoo.com (jt) wrote in message news:<6f**************************@posting.google. com>...
Is there a way to create a view that combines all rows from 2 tables
that have the same columns/fields?

thanks,
Judi


create view blah as
select *
from table1
union
select *
from table2

Performance will be disastrous.
Please reconsider the design

Sybrand Bakker
Senior Oracle DBA
Jul 19 '05 #4

P: n/a
"jt" <ju**********@yahoo.com> schrieb im Newsbeitrag
news:6f**************************@posting.google.c om...
Is there a way to create a view that combines all rows from 2 tables
that have the same columns/fields?

thanks,
Judi


Hi Judi,

minor addition to what 'osy45' and Sybrand wrote:
performance will be better if you make it a
UNION *ALL*.

Greetings,
Guido
Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.