当前位置: 代码迷 >> Oracle管理 >> sqlserver话语换成oracle
  详细解决方案

sqlserver话语换成oracle

热度:46   发布时间:2016-04-24 04:21:48.0
sqlserver语句换成oracle
 运行怎么里面函数怎么改,语句如下。怎么换成oracle的函数? 



SELECT     SUM(CONVERT(money, yavg)) / SUM(CONVERT(int, DAYS)) AS yavg, FproductID, NF, FproductName
FROM         (SELECT     SUBSTRING(CONVERT(varchar(10), DATEADD(ms, - 3, DATEADD(mm, DATEDIFF(m, 0, GetDate) + 1, 0)), 20), 9, 9) AS DAYS, 
                                              SUBSTRING(CONVERT(varchar(10), DATEADD(ms, - 3, DATEADD(mm, DATEDIFF(m, 0, GetDate) + 1, 0)), 20), 9, 9) * yuejunjia AS yavg, 
                                              SUBSTRING(CONVERT(varchar(10), DATEADD(ms, - 3, DATEADD(mm, DATEDIFF(m, 0, GetDate) + 1, 0)), 20), 1, 4) AS NF, FproductID, 
                                              FproductName
                       FROM          (SELECT DISTINCT c.FproductName, b.GetDate, b.yuehuanbi, b.yuetongbi, b.yuejunjia, b.FproductID
                                               FROM          dbo.ls_scb AS a INNER JOIN
                                                                      dbo.ls_jgb AS b ON a.MarketID = b.MarketID INNER JOIN
                                                                      dbo.ls_pzb AS c ON b.FproductID = c.FproductID
                                               WHERE      (a.MarketName = '上海市')) AS s) AS a
GROUP BY FproductID, NF, FproductName
------解决方案--------------------
引用:
叫着急帮你移。。

DBA-HUANGZHAOJI
名字打错了
  相关解决方案