Re: [SQL] Counting all rows

2007-06-23 Thread manchicken
On Saturday 23 June 2007 05:38:56 Andreas Kretschmer wrote: > Stefan Arentz <[EMAIL PROTECTED]> schrieb: > > I need to get statistics from a bunch of tables. Simply the number of > > records in them. > > > > The query plan looks like this: > > > > => explain select count(id) from stuff; > >

Re: [SQL] Counting all rows

2007-06-23 Thread Stefan Arentz
On 6/23/07, Andreas Kretschmer <[EMAIL PROTECTED]> wrote: Stefan Arentz <[EMAIL PROTECTED]> schrieb: > I need to get statistics from a bunch of tables. Simply the number of > records in them. > > The query plan looks like this: > > => explain select count(id) from stuff; >

Re: [SQL] join problem

2007-06-23 Thread Ragnar
On lau, 2007-06-23 at 04:15 -0500, A. R. Van Hook wrote: > Ragnar wrote: > > On fim, 2007-06-21 at 08:46 -0500, A. R. Van Hook wrote: > >> If I try an inclusive query using the following: > >> select > >> sum(i.rowtot + i.tax) as tot, > >> sum(v.deposit) as deposit > >> from ca

Re: [SQL] Counting all rows

2007-06-23 Thread Andreas Kretschmer
Stefan Arentz <[EMAIL PROTECTED]> schrieb: > I need to get statistics from a bunch of tables. Simply the number of > records in them. > > The query plan looks like this: > > => explain select count(id) from stuff; > QUERY PLAN > ---

[SQL] Counting all rows

2007-06-23 Thread Stefan Arentz
I need to get statistics from a bunch of tables. Simply the number of records in them. The query plan looks like this: => explain select count(id) from stuff; QUERY PLAN --- Aggregate (cost=1629.69..1629.

Re: [SQL] join problem

2007-06-23 Thread A. R. Van Hook
What is the correct query??? thanks Ragnar wrote: On fim, 2007-06-21 at 08:46 -0500, A. R. Van Hook wrote: if I query for the total deposit using select sum(deposit) from invoice where cusid = 2128" I also get 1179.24, also the correct amount If I try an inclusive query using th