游泳的大象 2017-05-25 08:52 采纳率: 0%
浏览 498

这条DB2语句怎么转为oracle?

WITH par(BRANCH_CODE,upper_cash_no) AS(
SELECT BRANCH_CODE,upper_cash_no FROM sys_org_tmp

WHERE BRANCH_CODE= $s{sys_user_sub_branch_orgno}
UNION ALL
SELECT og.BRANCH_CODE,og.upper_cash_no FROM sys_org_tmp og,par
WHERE og.BRANCH_CODE=par.upper_cash_no)

select sum(t.STOCK_QUANTITY) as total_number
from t9_prod_stock_info t
where t.prod_code = $S{prod_code}
and t.prod_sub_code = $S{prod_sub_code}
and t.LAW_MAN=$S{sys_user_contect}
and t.orgno in(
select par.BRANCH_CODE from par)

  • 写回答

1条回答 默认 最新

  • copeterol 2023-05-30 10:11
    关注
    
    WITH par(BRANCH_CODE, upper_cash_no) AS (
        SELECT BRANCH_CODE, upper_cash_no FROM sys_org_tmp
        WHERE BRANCH_CODE = :sys_user_sub_branch_orgno
        UNION ALL
        SELECT og.BRANCH_CODE, og.upper_cash_no FROM sys_org_tmp og, par
        WHERE og.BRANCH_CODE = par.upper_cash_no
    )
    SELECT SUM(t.STOCK_QUANTITY) AS total_number
    FROM t9_prod_stock_info t
    WHERE t.prod_code = :prod_code
    AND t.prod_sub_code = :prod_sub_code
    AND t.LAW_MAN = :sys_user_contect
    AND t.orgno IN (
        SELECT BRANCH_CODE FROM par
    )
    
    
    评论

报告相同问题?

悬赏问题

  • ¥200 基于同花顺supermind的量化策略脚本编辑
  • ¥20 Html备忘录页面制作
  • ¥15 黄永刚的晶体塑性子程序中输入的材料参数里的晶体取向参数是什么形式的?
  • ¥20 数学建模来解决我这个问题
  • ¥15 计算机网络ip分片偏移量计算头部是-20还是-40呀
  • ¥15 stc15f2k60s2单片机关于流水灯,时钟,定时器,矩阵键盘等方面的综合问题
  • ¥15 YOLOv8已有一个初步的检测模型,想利用这个模型对新的图片进行自动标注,生成labellmg可以识别的数据,再手动修改。如何操作?
  • ¥30 NIRfast软件使用指导
  • ¥20 matlab仿真问题,求功率谱密度
  • ¥15 求micropython modbus-RTU 从机的代码或库?