var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Merge DIFFERENT TABLES into ONE - HELP PLZ
I am very new to Sybase I have a very basic Question.
How do I merge tables resulted from Select queries into one? One after the other would do...
SELECT t1.Date, t1.Price FROM T1 WHERE ....
And another table that Iget from another select query
SELECR t2.DATE, t2.Price FROM T2 WHERE....
KNOWING THAT T1 and T2 have many different columns... so UNION ALL wont work....
Many thanks for your help!
If your SELECT statements have only the common columns, UNION ALL will work.
unfortunately it doesnt have the same columns....
I probably didnt express myself properly but this is what I am doing
QUERY1: SELECT T1.DATE_A, T1.PRICE_A FROM T1 WHERE ...
QUERY2: SELECT T2.DATE_B, T2.PRICE_B FROM T2 WHERE ...
so the columns I am putting together do not have the same name....but the same format.
I would like to have both of these results in one table.
I am doing this in SYBASE, I understand I could have done this in Oracle with a procedure ... maybe something along those lines?
As long as the columns have the same data type you can use union all
SELECT T1.DATE_A, T1.PRICE_A FROM T1 WHERE ...
SELECT T2.DATE_B, T2.PRICE_B FROM T2 WHERE ...
Query2: SELECT t2.date_B AS date_A, t2.price_B AS price_A FROM T2 ...
the columns will have the same name, too.
that was dumb of me, that worked thanks mate.