| Values to columns of another table [message #573058] |
Thu, 20 December 2012 07:00  |
srinivas.k2005
Messages: 242 Registered: August 2006
|
Senior Member |
|
|
Hi,
I need to add values of one column values from a table to another table each value as a column.
Below i am considering only for 3 values in real time i have more than 50 values
CREATE TABLE TEST_REG ( VAL VARCHAR2(1));
INSERT INTO TEST_REG VALUES ('A');
INSERT INTO TEST_REG VALUES ('B');
INSERT INTO TEST_REG VALUES ('C');
CREATE TABLE TEST_HOLD ( COL1 VARCHAR2(1),COL2 VARCHAR2(1),COL3 VARCHAR2(1)); -- in realtime i have 100 columns
Now i need the output as:
when i
select * from test_hold;
COL1 COL2 COL3
A B C
Thanks,
SRK
|
|
|
|
|
|
| Re: Values to columns of another table [message #573077 is a reply to message #573062] |
Thu, 20 December 2012 10:09   |
srinivas.k2005
Messages: 242 Registered: August 2006
|
Senior Member |
|
|
Its not Stupid case, may be you were unable to understand.
I have a master table with master region values..in above example A,B and C
Now i have another table where i need to insert each value in different column and show number of records belonging to that region..i made the same case simpler with above example.
|
|
|
|
|
|
|
|
|
|
|
|