Re: [SQL] How to get a count() where column < ''?

2005-12-04 Thread Stephan Szabo
On Sun, 4 Dec 2005, Joost Kraaijeveld wrote: > Hi Stephan, > > On Sun, 2005-12-04 at 13:33 -0800, Stephan Szabo wrote: > > > SELECT COUNT(customers.objectid) FROM prototype.customers, > > > prototype.addresses > > > WHERE > > > customers.contactaddress = addresses.objectid > > > AND > > > zipCode

Re: [SQL] How to get a count() where column < ''?

2005-12-04 Thread Joost Kraaijeveld
Hi Stephan, > A query without a group by, in other words one on which the count is done > over the entire set of rows that pass the where clause. OK. > I believe > select count(*) from prototype.customers, prototype.addresses where > customers.contactaddress = addresses.objectid and zipCode <

Re: [SQL] How to get a count() where column < ''?

2005-12-04 Thread Jim Johannsen
Joost Kraaijeveld wrote: Hi Stephan, On Sun, 2005-12-04 at 13:33 -0800, Stephan Szabo wrote: SELECT COUNT(customers.objectid) FROM prototype.customers, prototype.addresses WHERE customers.contactaddress = addresses.objectid AND zipCode < '2716BN' ORDER By zipCode, houseNumber I

Re: [SQL] How to get a count() where column < ''?

2005-12-04 Thread Joost Kraaijeveld
Hi Stephan, On Sun, 2005-12-04 at 13:33 -0800, Stephan Szabo wrote: > > SELECT COUNT(customers.objectid) FROM prototype.customers, > > prototype.addresses > > WHERE > > customers.contactaddress = addresses.objectid > > AND > > zipCode < '2716BN' > > ORDER By zipCode, houseNumber > In a non-groupe

Re: [SQL] How to get a count() where column < ''?

2005-12-04 Thread Stephan Szabo
On Sun, 4 Dec 2005, Joost Kraaijeveld wrote: > Hi, > > I want the number of customers that have a zipCode smaller tha a given > value. The foolowing query doe snot work : I get an error (ERROR: > column "addresses.zipcode" must appear in the GROUP BY clause or be used > in an aggregate function) a

[SQL] How to get a count() where column < ''?

2005-12-04 Thread Joost Kraaijeveld
Hi, I want the number of customers that have a zipCode smaller tha a given value. The foolowing query doe snot work : I get an error (ERROR: column "addresses.zipcode" must appear in the GROUP BY clause or be used in an aggregate function) and I do not know how to solve it. SELECT COUNT(customers

Re: [SQL] question using 'between' in a sql query

2005-12-04 Thread Theodore Petrosky
thanks... as is so often the case I discovered date_trunc('day', insertdate) between '11/20/2005' AND '11/20/2005' also works It wasn't until I pressed the send button that I thought of the solution. I have thought of creating a faux 'send' button for my email software... yours is a little e

Re: [SQL] SQL Statement Help needed

2005-12-04 Thread Andreas Kretschmer
Michael Avila <[EMAIL PROTECTED]> schrieb: > I am not much of a SQL guru so I am having trouble trying to figure out how > to format a SQL statement. > > I have a table with members named members. Each member has only 1 record. > Then I have a table with member telephone numbers in it name > memb

[SQL] SQL Statement Help needed

2005-12-04 Thread Michael Avila
I am not much of a SQL guru so I am having trouble trying to figure out how to format a SQL statement. I have a table with members named members. Each member has only 1 record. Then I have a table with member telephone numbers in it name membertelephones. A member can have more than one telephone