James Holmes wrote: > Ah, the PK on wrkenrolments is actually a separate column (enrolmentid) > so there isn't an index to use. Maybe I should define a composite key > for that purpose instead?
Yes, you very, very much should so. And not for the purpose of speed, but for the purpose of data integrity. Your query with subselects will throw an exception if there are multiple rows with the same periodid and unitid in the WRKENROLLMENTS table. Jochem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:208213 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

