sql在这里 select f_status, f_type,F_DIV_DEPART,F_SMALL_SENDER, F_DEPT_ID as id, F_VOUCHER_NUMBER as voucherNumber, F_SALE_DEPART as saleDepart, F_SMALL_DEPART as smallDepart, F_SALE_SENDER as UpDeptSender, F_BIG_DEPART as bigDepart, F_DIV_DEPART as division, F_DIV_DEPART as division from dpcrm.T_COMP_SOLVE_REPORT t left join ( SELECT DPT.FID, DPT.FDEPTCODE, DPT.FSTANDARDCODE,DPT.FDEPTNAME, DPT.FPRINCIPAL,DPT.FDEPTLEVEL,DPT.FPARENTID FROM DPCRM.T_ORG_DEPARTMENT DPT START WITH DPT.FID = 796931 CONNECT BY DPT.FID = PRIOR DPT.FPARENTID ORDER BY DPT.FID DESC FETCH FIRST 1 ROWS ONLY ) dpt on t.F_DEPT_ID=dpt.FID where f_type = 'DELIVER' and f_status = '1' and NVL(F_DIV_DEPART,'-') != '空运管理本部' and F_SMALL_SENDER = '796931'
时间: 2023-12-23 21:05:51 浏览: 135
A-wise-man-live.zip_4 3 2 1
这是一条 SQL 查询语句,它从表 T_COMP_SOLVE_REPORT 中选择 f_status、f_type、F_DIV_DEPART、F_SMALL_SENDER、F_DEPT_ID、F_VOUCHER_NUMBER、F_SALE_DEPART、F_SMALL_DEPART、F_SALE_SENDER、F_BIG_DEPART 和 division 这些列,并且通过左连接查询 T_ORG_DEPARTMENT 表以获取部门信息。查询条件包括 f_type 为 'DELIVER',f_status 为 '1',F_DIV_DEPART 不为 '空运管理本部',F_SMALL_SENDER 为 '796931'。查询结果将返回符合条件的记录集。
阅读全文