oracle语句如何转换为access语句,求教高人…

biduan09 2012-04-19 09:38:20
select d.jh,a.gj yg0_gj1,a.gs yg0_25, b.gj yg0_gj2,b.gs yg0_22, c.gj yg0_gj3,c.gs yg0_19,nvl(a.gs,0)+nvl(b.gs,0)+nvl(c.gs,0) yg0_xj1 from (select jh, gj, count(jh) gs from ys_ddh013 where gzxl = 1 and ggxh like '%25%' and jh=':tj_jh' and wgrq= (select max(wgrq)from ys_ddh013 where jh=':tj_jh' and wgrq < to_date(':tj_wgrq','yyyy-mm-dd')) group by jh,gj) a,(select jh, gj, count(jh) gs from ys_ddh013 where gzxl = 1 and ggxh like '%22%' and jh=':tj_jh' and wgrq= (select max(wgrq)from ys_ddh013 where jh=':tj_jh' and wgrq < to_date(':tj_wgrq','yyyy-mm-dd')) group by jh,gj) b,(select jh, gj, count(jh) gs from ys_ddh013 where gzxl = 1 and ggxh like '%19%' and jh=':tj_jh' and wgrq= (select max(wgrq)from ys_ddh013 where jh=':tj_jh' and wgrq < to_date(':tj_wgrq','yyyy-mm-dd')) group by jh,gj) c, (select ':tj_jh' jh from dual) d where d.jh =b.jh(+) and d.jh=c.jh(+) and d.jh=a.jh(+)
...全文
103 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
ACMAIN_CHM 2012-04-19
  • 打赏
  • 举报
回复
另外连接换成 left join
ACMAIN_CHM 2012-04-19
  • 打赏
  • 举报
回复
需要改的地方太多了,体力活啊。

你先把 NVL 换成ACCESS的NZ,或者IF (ISNULL
另外把to_date(.....) 直接换成 #2009-10-31#这种格式。
biduan09 2012-04-19
  • 打赏
  • 举报
回复
谢了哈…

7,714

社区成员

发帖
与我相关
我的任务
社区描述
Microsoft Office Access是由微软发布的关系数据库管理系统。它结合了 MicrosoftJet Database Engine 和 图形用户界面两项特点。
社区管理员
  • Access
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧