表 testdate 中字段 dateday 為連續的日期
表 manufacture 中 為統計表 finishday為其日期字段
兩表聯接我已經實現....select Dateday,
sum(case when (ProjectName='FG') and(realTime is not null) then realTime else 0 end) as FGreal,
convert(decimal(10,1), cast(sum(case when (ProjectName='FG') and(realTime is not null) then realTime else 0 end) as real)/100*100) as FGper
FROM { oj testday left OUTER JOIN
Manufacture ON convert(char(10),convert(smalldatetime,finishday),111) =convert(char(10),convert(smalldatetime,dateday),111) }
group by dateday
order by dateday結果 顯示如下: dateday FGreal FGper
2004/10/10 50 0.5
2004/10/11 60 0.6
2004/10/12 70 0.7
問題又出了一個表electrod yupaidate 為其日期字段
現在實現的問題就是三個表外聯接實現 顯示如下: dateday FGreal FGper 第三個表real 第三個表Per
2004/10/10 50 0.5 80 0.8
2004/10/11 60 0.6 90 0.9
2004/10/12 70 0.7 100 1等待你們的幫組!
表 manufacture 中 為統計表 finishday為其日期字段
兩表聯接我已經實現....select Dateday,
sum(case when (ProjectName='FG') and(realTime is not null) then realTime else 0 end) as FGreal,
convert(decimal(10,1), cast(sum(case when (ProjectName='FG') and(realTime is not null) then realTime else 0 end) as real)/100*100) as FGper
FROM { oj testday left OUTER JOIN
Manufacture ON convert(char(10),convert(smalldatetime,finishday),111) =convert(char(10),convert(smalldatetime,dateday),111) }
group by dateday
order by dateday結果 顯示如下: dateday FGreal FGper
2004/10/10 50 0.5
2004/10/11 60 0.6
2004/10/12 70 0.7
問題又出了一個表electrod yupaidate 為其日期字段
現在實現的問題就是三個表外聯接實現 顯示如下: dateday FGreal FGper 第三個表real 第三個表Per
2004/10/10 50 0.5 80 0.8
2004/10/11 60 0.6 90 0.9
2004/10/12 70 0.7 100 1等待你們的幫組!
解决方案 »
- 两个表中的字段值相减问题
- 关于循环语句取值问题
- 如何获取一个日期的年份和月份
- DataSet导出至Excel的控件
- 放100分 求解2个问题 请问用Delphi怎么控制PowerDVD的播放,暂停等 怎么控制PowerPoint的播放,停止,前一屏,后一屏等
- delphi xe2 的 datasnap 限制同一帐户同时登录 如何实现?
- 在线等待,一个DLL返回值类型的问题,各位帮忙看看问题出在哪?
- 关于TreeView
- 关于购买正版Delphi的问题
- Delphi与Oracle的问题?Why???ApplyUpdates用不了了???
- 挑選符合條件的最接近的數據!
- rave解決方案 .網絡資源共享.來者有分!
2004/10/10 50 0.5 80 0.8
2004/10/11 60 0.6 90 0.9
2004/10/12 70 0.7 100 1三個表聯接條件是 testday.dateday=electrod.yupaidate=Manufacture.finishday
(两个表JOIN的语句)AS T1, 这样就变成T1表与第三个表的联接问题了。。
lk