Incomplete result set
Posted in 1997
Hi!
One of our programmers has come upon an interesting anomaly. She's trying
to execute the following query:
select work_order_nbr,
sum(amount)
from py_te_39
where work_order_nbr in ("97-0000-001", "97-0000-002", "97-0000-003")
group by 1
union all
select work_order_nbr,
sum(amount)
from py_te_hist_45
where work_order_nbr in ("97-0000-001", "97-0000-002", "97-0000-003")
group by 1
order by 1
This produced a result set like:
work_order_nbr (expression)
7-0000-001 5000.00
7-0000-002 3590.00
7-0000-003 4320.00
97-0000-001 7098.89
97-0000-002 9077.84
97-0000-003 3421.56
Notice that the result set for the query on py_te_39 had the front "9" in
the work_order_nbr mysteriously removed. If we change the order of the
select statements, it still disappears from the py_te_39 result set. If werun the queries separately (not a union), the correct result set is
returned, with no data dropped.
I recall seeing this problem on another system about two years ago, running
an earlier release of OnLine 5.x on another platform. Our system is:
DEC AlphaServer 2100
Digital Unix 3.0b
OnLine 5.05.UC1
ISQL 4.13.UD1
If she runs the query in the interactie Query editor or as part of an ACE
report she gets the same problem. We also tried selecting the sum(amount)
first and then the work_order_nbr and selecting a dummy constant first:
select "x", work_order_nbr, sum(amount) ...
but neither approach worked.
Does anyone have any idea what could be the reason? Thanks for your help.
Best regards,
Nigel
+-------------------------------------------------------------+
|Name : Edmund Nigel Gall Tel: (868) 636 3153 |
|Title : Information Systems Specialist Fax: (868) 679 3770 |
|Company: Process Plant Services Limited |
|Address: Atlantic Avenue, Point Lisas Industrial Estate |
| Point Lisas, Couva, Trinidad & Tobago, W.I. |
+----- mailto:nigelg@ppsl.com ------ http://www.ppsl.com -----+