oracle合并sql,Oracle SQL-使用合并功能
发布日期:2021-06-24 15:51:42 浏览次数:2 分类:技术文章

本文共 1048 字,大约阅读时间需要 3 分钟。

我真的无法理解合并功能……或者这甚至不是获得我想要达到的结果的最佳方法.

我在以下脚本中有三个日期(iv.dated,iv1.dated和dh.actshpdate).当我运行以下脚本时,日期位于单独的列中(按预期);

select unique li.catnr, li.av_part_no, li.artist||' / '||li.title description, li.cust_catnr pallet_ref,

trunc(iv.dated), trunc(iv1.dated), trunc(dh.actshpdate)

from leos_item li

left join invtran_view_oes iv

on li.av_part_no = iv.part_no

and (iv.transaction = 'NREC' and iv.location_no = ' RETURNS W')

left join invtran_view_oes iv1

on li.av_part_no = iv1.part_no

and (iv1.transaction = 'CORR+' and iv1.remark like 'STOCK FROM SP PALLET%')

left join oes_delsegview od

on od.catnr = li.catnr

and od.prodtyp = li.prodtyp

and od.packtyp = li.packtyp

left join oes_dpos dp

on od.ordnr = dp.ordnr

and od.posnr = dp.posnr

and od.segnr = dp.segnr

left join oes_dhead dh

on dp.dheadnr = dh.dheadnr

where li.cunr = '816900'

and substr(li.catnr,1,5) in ('RGMCD','RGJCD')

and li.item_type = 'FP'

and li.catnr = 'RGJCD221'

我想实现的是一列按日期顺序排列的所有日期.

我尝试用…替换我的日期

trunc(coalesce(iv.dated, iv1.dated, dh.actshpdate)) transaction_date

…但是,我失去了一些约会;

如何获得以下结果?

转载地址:https://blog.csdn.net/weixin_33642922/article/details/116532879 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:linux文件大小 按兆,du命令 实现Linux 某个文件夹下的文件按大小排序
下一篇:oracle library命中率,oracle命中率查询

发表评论

最新留言

感谢大佬
[***.8.128.20]2024年04月11日 16时42分35秒