Redian新闻
>
How to write this query in Oracle?
avatar
How to write this query in Oracle?# Database - 数据库
h*y
1
请问找人写推荐信的时候,那个信的地址写的是哪里啊? 我看了一些朋友申请的
package,同样给一个人的推
荐信,有些推荐人写carlifornia center,有些写VSC,有些写Texas的,到底应该写哪
里啊?有个什么样
的rule吗? 晕~~~
avatar
b*m
2
总文章数要奔50000嘞~大家再接再厉吧!
avatar
d*n
3
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
avatar
R*m
4
把我家漏的水搬这里,50000 马上到。
avatar
a9
5
有个旋转的关键字
sqlserver里是pivot

value.

【在 d*******n 的大作中提到】
: 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

avatar
b*m
6
快搬快搬,这里不怕涝~O(∩_∩)O哈哈哈~

【在 R********m 的大作中提到】
: 把我家漏的水搬这里,50000 马上到。
avatar
B*g
7
homework?suppose the 3rd cloumn x should be x1, suppose no dup max value in
a row
SELECT CASE GREATEST (ABS(x), ABS(y), ABS(x1), ABS(z))
WHEN ABS(x) THEN 'x'
WHEN ABS(y) THEN 'y'
WHEN ABS(x1) THEN 'x1'
ELSE 'z'
END CASE
FROM t_1

value.

【在 d*******n 的大作中提到】
: 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

avatar
R*n
8
删水 , 合集 会减少发帖量
avatar
d*n
9
Perfect! Thanks a lot!
Not for homework but work.

in

【在 B*****g 的大作中提到】
: homework?suppose the 3rd cloumn x should be x1, suppose no dup max value in
: a row
: SELECT CASE GREATEST (ABS(x), ABS(y), ABS(x1), ABS(z))
: WHEN ABS(x) THEN 'x'
: WHEN ABS(y) THEN 'y'
: WHEN ABS(x1) THEN 'x1'
: ELSE 'z'
: END CASE
: FROM t_1
:

avatar
D*l
10
幽默

【在 R********m 的大作中提到】
: 把我家漏的水搬这里,50000 马上到。
avatar
d*n
11
One more question. Is this exactly same as
SELECT
DECODE(GREATEST (ABS(x), ABS(y), ABS(x1), ABS(z)), ABS(x), 'x',

ABS(y), 'y',

ABS(x1), 'x1',

'z')
FROM

【在 B*****g 的大作中提到】
: homework?suppose the 3rd cloumn x should be x1, suppose no dup max value in
: a row
: SELECT CASE GREATEST (ABS(x), ABS(y), ABS(x1), ABS(z))
: WHEN ABS(x) THEN 'x'
: WHEN ABS(y) THEN 'y'
: WHEN ABS(x1) THEN 'x1'
: ELSE 'z'
: END CASE
: FROM t_1
:

avatar
b*m
12
少删,不做合集^_^
看某版30多玩的帖子,正羡慕呢~

【在 R*******n 的大作中提到】
: 删水 , 合集 会减少发帖量
avatar
B*g
13
same.




value

【在 d*******n 的大作中提到】
: One more question. Is this exactly same as
: SELECT
: DECODE(GREATEST (ABS(x), ABS(y), ABS(x1), ABS(z)), ABS(x), 'x',
:
: ABS(y), 'y',
:
: ABS(x1), 'x1',
:
: 'z')
: FROM

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。