This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / small question: how to turn column into row? I use Oracle
ThanksI had that script, but just can't find it now.
-alan_wang99(Baby);
2003-10-3
{47}
(#1397097@0)
-
What you mean here? turn column names into rows or turn one row data into rows, each row contains a column data?
-anno(烦人);
2003-10-3
(#1397103@0)
-
HeheA column X has value a1,a2,b1,B2 .... etc.
select X from table, the result will display like
X
---
a1
a2
b1
B2 ....
and What I want is to display like this
a1 a2 b1 b2
Thanks,
-alan_wang99(Baby);
2003-10-3
{190}
(#1397130@0)
-
Open the table multi-times
-handd(大熊猫®);
2003-10-9
(#1405162@0)
-
If you want do it in One SQL, then there is some limitation. If you know all the colume values, then you can do it. Otherwise you can not. Please check inside.
-funnyguy(喜欢加拿大);
2003-10-9
{1625}
(#1405263@0)
-
if it is a single column table, what can you do?...
-handd(大熊猫®);
2003-10-9
(#1406114@0)
-
Then it does not make sense to turn it into one row. I do not think you have any real examples having this kind of requirement. Anyway, you still can do it through multi-SQL .
-funnyguy(喜欢加拿大);
2003-10-10
(#1407009@0)
-
Can you solve my 'silly' problem...(This would be a interesting script)Here is my table in Oracle DB:
Col
-----
1
2
3
4
5
6
7
I am expecting the output as
My_Output
--------------
1234567
-handd(大熊猫®);
2003-10-10
{129}
(#1407447@0)
-
If you think it is a stupid question, then why I should bother to fix it. I do not want to be looked as a geek. Do something useful please.
-funnyguy(喜欢加拿大);
2003-10-10
(#1407464@0)