由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - Help on Oracle Query
相关主题
How to write this query in Oracle?a sql question
怎么写个query 把输出变成横排.问个SQL问题
query: in sql server 2005这个 Oracle SQL 语句该这么写啊?
better solution for cross table query in sql?大家帮忙看看这个oracle statement, 怎么总是报错?
Query help - pivot tableoracle和XML
oracle杂志还真有人读需要帮助 -- Oracle Query
One sql question help!Oracle,table有上千个column
ask for help with a simple query!!!菜鸟请教一个关于oracle里日期的问题
相关话题的讨论汇总
话题: query话题: oracle话题: 2009话题: c4话题: c3
进入Database版参与讨论
1 (共1页)
b******y
发帖数: 139
1
I have a record set like below:
CloseDate Category Price
2009-12-09 C1 100.21
2009-12-09 C2 98.41
2009-12-09 C3 96.41
2009-12-08 C1 100.13
2009-12-08 C2 98.33
2009-12-08 C3 96.33
2009-12-07 C1 100.2
2009-12-07 C2 98.25
2009-12-07 C3 96.25
2007-10-05 C4 97.4
2007-10-04 C4 97.3
2007-10-03 C4 97.3
2007-10-04 C5 98.5
2007-10-03 C5 98.4
I am trying to write a query to get columns includin
c**t
发帖数: 2744
2
home work?

【在 b******y 的大作中提到】
: I have a record set like below:
: CloseDate Category Price
: 2009-12-09 C1 100.21
: 2009-12-09 C2 98.41
: 2009-12-09 C3 96.41
: 2009-12-08 C1 100.13
: 2009-12-08 C2 98.33
: 2009-12-08 C3 96.33
: 2009-12-07 C1 100.2
: 2009-12-07 C2 98.25

b******y
发帖数: 139
3
This is for work.

【在 c**t 的大作中提到】
: home work?
c**t
发帖数: 2744
4
a classical pivot query

【在 b******y 的大作中提到】
: This is for work.
B*****g
发帖数: 34098
5
when you ask oracle questine, let us know your oracle version.

【在 b******y 的大作中提到】
: I have a record set like below:
: CloseDate Category Price
: 2009-12-09 C1 100.21
: 2009-12-09 C2 98.41
: 2009-12-09 C3 96.41
: 2009-12-08 C1 100.13
: 2009-12-08 C2 98.33
: 2009-12-08 C3 96.33
: 2009-12-07 C1 100.2
: 2009-12-07 C2 98.25

b******y
发帖数: 139
6
Oracle 10g

【在 B*****g 的大作中提到】
: when you ask oracle questine, let us know your oracle version.
B*****g
发帖数: 34098
7
SELECT *
FROM (SELECT closedate,
MAX(DECODE(category, 'C1', price, 0)) c1,
MAX(DECODE(category, 'C2', price, 0)) c2,
MAX(DECODE(category, 'C3', price, 0)) c3,
MAX(DECODE(category, 'C4', price, 0)) c4,
MAX(DECODE(category, 'C5', price, 0)) c5
FROM tbl
GROUP BY closedate)

【在 b******y 的大作中提到】
: Oracle 10g
1 (共1页)
进入Database版参与讨论
相关主题
菜鸟请教一个关于oracle里日期的问题Query help - pivot table
A sql questionoracle杂志还真有人读
用SSIS EXPORT 到 EXCEL 2010 有2000个COLUMN,可能吗One sql question help!
Oracle Group and Index questionask for help with a simple query!!!
How to write this query in Oracle?a sql question
怎么写个query 把输出变成横排.问个SQL问题
query: in sql server 2005这个 Oracle SQL 语句该这么写啊?
better solution for cross table query in sql?大家帮忙看看这个oracle statement, 怎么总是报错?
相关话题的讨论汇总
话题: query话题: oracle话题: 2009话题: c4话题: c3