Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!mtxinu!sybase!jeffl@sybase.Sybase.COM From: jeffl@sybase.Sybase.COM (Jeff Lichtman) Newsgroups: comp.databases Subject: Re: Informix sql sum/group by question Message-ID: <3515@sybase.sybase.com> Date: 25 Mar 89 19:50:44 GMT References: <334@sorsac.UUCP> Sender: news@sybase.sybase.com Distribution: na Lines: 30 || COL1 | COL2 | COL3 || ------------------ || 1 | 1 | 1 || 2 | 1 | 1 || 3 | 1 | 2 || 4 | 2 | 1 || 5 | 2 | 2 || - - || select sum(COL1), COL2 from TABX || - - | | With the above values in TABX, it seems the statement | would produce the result: | | | COL2 | ------------ | 15 | 1 | 15 | 1 | 15 | 1 | 15 | 2 | 15 | 2 Oops. Yes, you're right. My original posting had the wrong result for this query. The result I gave was for the query: select sum(COL1), COL1 from TABX --- Jeff Lichtman at Sybase {mtxinu,pacbell}!sybase!jeffl -or- jeffl@sybase.com "Saints should always be judged guilty until they are proved innocent..."