0

I am using oracle 10g and just wanted to know , if the below mentioned thing is possible or not.

I have to select two different values from two different tables and the output needs to be shown as a single row, with 2 columns.

Example scenario:-

Select col1 as A1  from table1 ;

Select clo2  as A2 from table2;

The output should be displayed as

A1. | A2

V1. |  V2        

Where V1 , V2 are values from the above select queries.

Tharif
  • 13,794
  • 9
  • 55
  • 77
Sid ABS
  • 59
  • 1
  • 11
  • See [**Oracle String Aggregation Techniques**](http://lalitkumarb.com/2015/10/12/oracle-string-aggregation-techniques/) – Lalit Kumar B Nov 27 '15 at 05:34
  • The link you have posted refers to retrieving different columns from same table. Here it is different columns from different tables . please correct me . if I am wrong in understanding your post – Sid ABS Nov 27 '15 at 05:44
  • it is simple, `UNION ALL` the output and then apply the logic. Or, if you could `JOIN` the tables. Whatever it is, all you want is to aggregate the output. – Lalit Kumar B Nov 27 '15 at 05:46

1 Answers1

-1

As @Lalit Kumar B says:

Select col1 as A1  from table1
UNION ALL
Select clo2  as A2 from table2

Remember you must have equal amount of columns selected from each table.

Joakim M
  • 1,793
  • 2
  • 14
  • 29