
5-12 Implement: Making Required Application Changes
If Your Current Version is 4.x Adaptive Server Enterprise 11.5
Aggregates with exists
SQL Server 4.x sometimes returned the wrong answer when a query
contained an aggregate, a correlated subquery contained an
exists
predicate, and the table in the subquery’s from clause contained
duplicates. This happened because the server processed the query as
a join and counted each matching row.
As of version 10.0, you get correct results without having to write
extra code. There are no risks associated with this change.
This example from pubs2 compares results for this type of query:
select count(*)
from publishers
where exists
(select * from titles
where titles.pub_id = publishers.pub_id)
Release 4.x
Results
Release 10.x and 11.x
Results
0736 5
0877 7
1389 6
0736 5
0736 5
0736 5
0736 5
0736 5
0877 7
0877 7
0877 7
0877 7
0877 7
0877 7
0877 7
1389 6
1389 6
1389 6
1389 6
1389 6
1389 6
Release 4.x
Results
Release 10.x and 11.x
Results
18 3
Comentarios a estos manuales