crystal 用户定义的命令中忽略了 Order by 子句
Order by clause ignored in crystal user defined command
我在 crystal 2013 中使用以下查询作为用户定义的命令命令。它 returns 和命令在 sql 开发人员中正确但是当我将它添加到我的报告中时这些字段要么以错误的顺序 return 编辑了两次 and/or。它应该 return 基于 ID 升序的行,例如39-40-41-42。但是 returns 39-41-40-42... 或 3939-4141-4040-4242。所以好像有规律..
select ad.arinvt_id,
ud.parent_id, listagg(ud.cuser, '') within group (order by ud.parent_id) as sfdt,
listagg(ud.ud_cols_id, '') within group (order by ud.ud_cols_id) as uci
from arinvoice_detail ad
left join ud_data ud
on ad.arinvt_id = ud.parent_id
where ad.arinvt_id = ud.parent_id
and ud.ud_cols_id in (39, 40, 41, 42)
group by ad.arinvt_id, ud.parent_id
我没能找到多少,我找到的是在不同的平台上。非常感谢任何帮助!
我看到了这个:
并尝试更改为
(order by field(xyz))
但 crystal 不会接受。
我链接了 table 两次。一旦进入命令,再次进入 crystal。不知道为什么它有时重复而不是其他,或者为什么顺序是倾斜的..但下面的命令到目前为止有效。
select
ud.parent_id,
listagg(ud.cuser, '') within group (order by ud.ud_cols_id) as sfdt
from ud_data ud
where ud.ud_cols_id in (39, 40, 41, 42)
group by ud.parent_id
我在 crystal 2013 中使用以下查询作为用户定义的命令命令。它 returns 和命令在 sql 开发人员中正确但是当我将它添加到我的报告中时这些字段要么以错误的顺序 return 编辑了两次 and/or。它应该 return 基于 ID 升序的行,例如39-40-41-42。但是 returns 39-41-40-42... 或 3939-4141-4040-4242。所以好像有规律..
select ad.arinvt_id,
ud.parent_id, listagg(ud.cuser, '') within group (order by ud.parent_id) as sfdt,
listagg(ud.ud_cols_id, '') within group (order by ud.ud_cols_id) as uci
from arinvoice_detail ad
left join ud_data ud
on ad.arinvt_id = ud.parent_id
where ad.arinvt_id = ud.parent_id
and ud.ud_cols_id in (39, 40, 41, 42)
group by ad.arinvt_id, ud.parent_id
我没能找到多少,我找到的是在不同的平台上。非常感谢任何帮助!
我看到了这个:
(order by field(xyz))
但 crystal 不会接受。
我链接了 table 两次。一旦进入命令,再次进入 crystal。不知道为什么它有时重复而不是其他,或者为什么顺序是倾斜的..但下面的命令到目前为止有效。
select
ud.parent_id,
listagg(ud.cuser, '') within group (order by ud.ud_cols_id) as sfdt
from ud_data ud
where ud.ud_cols_id in (39, 40, 41, 42)
group by ud.parent_id