Icon View Incident Report

Serious Serious
Reported By: Richard Harding
Reported On: 7/9/2009
For: Version 2.02 Build 14
# 3025 Aggregate Functions Not Returning Correct Results with Single-Row SELECT Queries with WHERE Clause

I have 2 tables below.

ContactRoles (ID, ContactID, RoleTypeID)
RoleTypes (ID, Name)

I wish to list the roles for a contact, say Fred is an Accountant,Conveyancer.

Query 1 & Query 2 below give the same results when Fred has some roles assigned. If Fred does not have any roles then Query 1 and Query 2 give different results.

Query 1
---------

SELECT List(Name) AS ContactRoleList
  FROM ContactRoles
     INNER JOIN RoleTypes ON ContactRoles.RoleTypeID = RoleTypes.ID
  WHERE ContactID = 10968
  GROUP BY ContactID

Gives a NULL ContactRoleList which is correct.

Query 2
---------

Take the GROUP BY clause out, then obtain different results.

SELECT List(Name) AS ContactRoleList
  FROM ContactRoles
     INNER JOIN RoleTypes ON ContactRoles.RoleTypeID = RoleTypes.ID
  WHERE ContactID = 10968

Gives a ContactRoleList of Vendor Solicitor - Vendor Solictor is the first
item in ContactRoles table.



Resolution Resolution
Fixed Problem on 7/11/2009 in version 2.02 build 15


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial
ElevateDB LCL Standard with Source
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image