数据集的制作

以下是数据库的脚本,我想增加一个wo_no(工单号的意思)的参数,想通过wo_no这个参数去查询数据,如何操作

select sn,wo_no from IMPORT_RUNCARD_sn where wo_no='MO4506A013'

and 1=1

and sn not in (

select detail.sn from SMT_MULTIPANEL_header head, SMT_MULTIPANEL_DETAIL detail

where 1=1

and head.id=detail.MULT_HEADER_ID

and head.wo_no='MO4506A013')

FineReport 1104845 发布于 2024-5-28 08:03 (编辑于 2024-5-28 08:03)
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共2回答
最佳回答
0
JL98Lv6中级互助
发布于2024-5-28 08:04(编辑于 2024-5-28 08:07)

select sn,wo_no from IMPORT_RUNCARD_sn where wo_no='MO4506A013'

and 1=1

and sn not in (

select detail.sn from SMT_MULTIPANEL_header head, SMT_MULTIPANEL_DETAIL detail

where 1=1

and head.id=detail.MULT_HEADER_ID

and head.wo_no='${参数名}')

PS:参数名可以自定义

参考文档数据集参数 https://help.fanruan.com/finereport/doc-view-158.html

image.png

最佳回答
0
xyz168Lv2见习互助
发布于2024-5-28 08:19

select sn, wo_no

  from IMPORT_RUNCARD_sn

 where wo_no = '${wo_no}'

   and 1 = 1      

   and sn not in (        

        select detail.sn

          from SMT_MULTIPANEL_header head, SMT_MULTIPANEL_DETAIL detail        

         where 1 = 1              

           and head.id = detail.MULT_HEADER_ID              

           and head.wo_no = '${wo_no}')

------------------------------------

wo_no为参数名

空间名需要与参数保存一致

  • 3关注人数
  • 82浏览人数
  • 最后回答于:2024-5-28 08:19
    请选择关闭问题的原因
    确定 取消
    返回顶部