Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 3 of 3 total |
LIST function |
Thu, Jul 9 2009 3:42 AM | Permanent Link |
Richard Harding | Tim,
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. SELECT * FROM ContactRoles INNER JOIN RoleTypes ON ContactRoles.RoleTypeID = RoleTypes.ID WHERE ContactID = 10968 Gives an empty result set. 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. Richard Harding |
Thu, Jul 9 2009 11:35 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Richard,
<< Take the GROUP BY clause out, then obtain different results. >> Got it. A fix will be in the next build. Thanks, -- Tim Young Elevate Software www.elevatesoft.com |
Mon, Jul 13 2009 12:48 AM | Permanent Link |
Richard Harding | >> Got it. A fix will be in the next build.
Thanks Tim . . . . Richard Harding |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |