Path: utzoo!attcan!uunet!world!decwrl!nsc!pyramid!infmx!dberg From: dberg@informix.com (David I. Berg) Newsgroups: comp.databases Subject: Re: Joining 3 tables (sort of) in SQL Keywords: SQL Message-ID: <1990Nov21.153314.3191@informix.com> Date: 21 Nov 90 15:33:14 GMT References: <322@cti1.UUCP> Sender: news@informix.com (Usenet News) Organization: Informix Software, Inc. Lines: 10 In article <322@cti1.UUCP> kmeek@cti1.UUCP (Kevin Meek) writes: >We want an output record for each planning record with the corresponding >account information included and (this is the tricky part) the sum >of all spending records for that account. > select account.account_number,account.account_information, planning.planning_data,sum(spending.spending_data) where spending.account_number = planning.account_number and planning.account_number = account.account_number group by account_number,account_information,planning_data