d*******n 发帖数: 524 | 1 【 以下文字转载自 Database 讨论区 】
发信人: dArtagnan (达达尼昂), 信区: Database
标 题: How to write this query in Oracle?
发信站: BBS 未名空间站 (Tue Dec 8 10:42:40 2009, 美东)
We have a table (T_1) with e.g. 4 columns
T_1:
x y x z
1 2 3 4
3 6 1 -1
6 3 2 0
5 3 2 -10
I need a query to find out in each row which column has the max absolute value.
That is, I need to get the following table as output:
max_col
z
y
x
z
How to write this query in Oracle?
Thanks | j******n 发帖数: 271 | 2 cat << xxxx | mail -s "help" E*****[email protected]
We have a table (T_1) with e.g. 4 columns
T_1:
x y x z
1 2 3 4
3 6 1 -1
6 3 2 0
5 3 2 -10
I need a query to find out in each row which column has the max absolute
value.
That is, I need to get the following table as output:
max_col
z
y
x
z
How to write this query in Oracle?
Thanks
xxxx
|
【在 d*******n 的大作中提到】 : 【 以下文字转载自 Database 讨论区 】 : 发信人: dArtagnan (达达尼昂), 信区: Database : 标 题: How to write this query in Oracle? : 发信站: BBS 未名空间站 (Tue Dec 8 10:42:40 2009, 美东) : We have a table (T_1) with e.g. 4 columns : T_1: : x y x z : 1 2 3 4 : 3 6 1 -1 : 6 3 2 0
| d*******n 发帖数: 524 | 3 ?
【在 j******n 的大作中提到】 : cat << xxxx | mail -s "help" E*****[email protected] : We have a table (T_1) with e.g. 4 columns : T_1: : x y x z : 1 2 3 4 : 3 6 1 -1 : 6 3 2 0 : 5 3 2 -10 : I need a query to find out in each row which column has the max absolute : value.
|
|