运行怎么里面函数怎么改,语句如下。怎么换成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
------解决方案--------------------
名字打错了