由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - How to write this query
相关主题
sql query questionA sql question
Undefined function 'Date' in Expressionhow to make query faster?
关于Acess的简单问题query estimation shows cost 900%?
一个SQL query的问题oracle JDBC thin vs. JDBC OCI
Question 2: distributed database question?再问个excel问题吧
[转载] question about SQL in Access急,SQL2005, 怎么查过去一小时里run过的所有query?
[转载] Can anyone interpret this simple SQL?Late afternoon 腦不好使
请教一个query请教一个mssql的问题
相关话题的讨论汇总
话题: 01话题: 05话题: date话题: query话题: write
进入Database版参与讨论
1 (共1页)
b*****o
发帖数: 284
1
Suppose I have a table taking care of incoming:
Date amount unit_price($)
01/01/05 5 7
01/02/05 4 2
01/03/05 6 3
01/04/05 3 6
01/05/05 8 1
Also have a table taking care of outgoing:
Date amount cost($)
01/01/05 2
01/02/05 7
01/03/05 6
01/04/05 3
01/05/05 4
I would like to define the outgoing cost using "First in First out", so the
cost should be calculated as:
Date amount cost($)
01/01/05 2 2*$7
s******n
发帖数: 45
2
simple query can't do this bah? at least u need a sproc with cursor...

【在 b*****o 的大作中提到】
: Suppose I have a table taking care of incoming:
: Date amount unit_price($)
: 01/01/05 5 7
: 01/02/05 4 2
: 01/03/05 6 3
: 01/04/05 3 6
: 01/05/05 8 1
: Also have a table taking care of outgoing:
: Date amount cost($)
: 01/01/05 2

1 (共1页)
进入Database版参与讨论
相关主题
请教一个mssql的问题Question 2: distributed database question?
parameterized queries with no inputs[转载] question about SQL in Access
Re: Recordset - I stuck! Help![转载] Can anyone interpret this simple SQL?
A SQL query never stop running is bothering me: help needed (转载)请教一个query
sql query questionA sql question
Undefined function 'Date' in Expressionhow to make query faster?
关于Acess的简单问题query estimation shows cost 900%?
一个SQL query的问题oracle JDBC thin vs. JDBC OCI
相关话题的讨论汇总
话题: 01话题: 05话题: date话题: query话题: write