由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - 大家帮忙看看这个oracle statement, 怎么总是报错?
相关主题
服了,这就是我们QA和DBA的水平是学Oracle还是SQL server?
How to write this query in Oracle?oracle和XML
Help on Oracle Query1. Oracle vs. SQL92 Re: Just
Oracle 求助Stored Procedure?
temp table problemHow to list all the tables in oracle?
包子题 (1st answer 100新币)ORACLE+VC产生巨大临时文件
t-sql chanllege 20数据库问题求解
跪求高人指点:一道SQL题3/5个包子可以么?先谢了!Oracle急问
相关话题的讨论汇总
话题: sum话题: currency话题: company话题: select话题: status
进入Database版参与讨论
1 (共1页)
s******d
发帖数: 901
1
谢谢了。
select available.company_id, available.currency, available.sum, pending_paid
.sum
from (
(select company_id, currency, sum(value) as sum from
member_transactions where status ='A'
group by currency, company_id) as available
inner join
(select company_id, currency, sum(value) as sum from
member_transactions where status ='P'
group by currency, company_id) as pending_paid
on available.company_id=pending_paid.company_id
and available
s******d
发帖数: 901
2
解决了,去掉“as"就好了
B*****g
发帖数: 34098
3
select company_id, currency, sum(DECODE(status, 'A', value, 0)) as A_sum , s
um(DECODE(status, 'P', value, 0)) as p_sum
from member_transactions
where status ='A' OR status ='P'
group by currency, company_id

paid

【在 s******d 的大作中提到】
: 谢谢了。
: select available.company_id, available.currency, available.sum, pending_paid
: .sum
: from (
: (select company_id, currency, sum(value) as sum from
: member_transactions where status ='A'
: group by currency, company_id) as available
: inner join
: (select company_id, currency, sum(value) as sum from
: member_transactions where status ='P'

1 (共1页)
进入Database版参与讨论
相关主题
Oracle急问temp table problem
question on JOIN on Oracle包子题 (1st answer 100新币)
dbi connect to oraclet-sql chanllege 20
how to check transaction跪求高人指点:一道SQL题3/5个包子可以么?先谢了!
服了,这就是我们QA和DBA的水平是学Oracle还是SQL server?
How to write this query in Oracle?oracle和XML
Help on Oracle Query1. Oracle vs. SQL92 Re: Just
Oracle 求助Stored Procedure?
相关话题的讨论汇总
话题: sum话题: currency话题: company话题: select话题: status